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/2f71bb978a6003bef261f6e7b3f8cce2 to your computer and use it in GitHub Desktop.
Save Waksuu/2f71bb978a6003bef261f6e7b3f8cce2 to your computer and use it in GitHub Desktop.
const moviesInitialState: MovieDTO[] = [];
export const movieReducer = (
state = moviesInitialState,
action: MovieListActionTypes
): MovieDTO[] => {
switch (action.type) {
case MovieListRetrieved:
return action.movies;
case ClearMovieListRequest:
return [];
default:
return state;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment