Skip to content

Instantly share code, notes, and snippets.

@Waksuu
Created March 25, 2020 20:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Waksuu/5b1d89431663733cfb543fb3409500e0 to your computer and use it in GitHub Desktop.
Save Waksuu/5b1d89431663733cfb543fb3409500e0 to your computer and use it in GitHub Desktop.
export const retrieveMoviesAction = (getAllMovies: () => Promise<MovieDTO[]>): ThunkAction<Promise<void>,
AppState,
undefined,
AppActions
> => async (dispatch: ThunkDispatch<AppState, undefined, AppActions>) => {
const movies: MovieDTO[] = await getAllMovies();
dispatch(moviesRetrieved(movies));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment