Skip to content

Commit 7c6c98c

Browse files
committed
refactor: makes api functions async
1 parent cc9ebc3 commit 7c6c98c

File tree

1 file changed

+2
-2
lines changed
  • examples/react-native/src/lib

1 file changed

+2
-2
lines changed

examples/react-native/src/lib/api.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ function delay(t: number, v: () => void) {
1818
});
1919
}
2020

21-
export function fetchMovies(): Promise<Movie[]> {
21+
export async function fetchMovies() {
2222
console.log('fetchMovies');
2323
return delay(200 + Math.floor(Math.random() * 2000), () =>
2424
movies
@@ -27,7 +27,7 @@ export function fetchMovies(): Promise<Movie[]> {
2727
) as Promise<Movie[]>;
2828
}
2929

30-
export function fetchMovie(title: string): Promise<MovieDetails> {
30+
export async function fetchMovie(title: string) {
3131
console.log('fetchMovie', title);
3232
return delay(200 + Math.floor(Math.random() * 2000), () => {
3333
const result = movies.filter((item) => item.title === title);

0 commit comments

Comments
 (0)