Skip to content

Instantly share code, notes, and snippets.

@bardiarastin
Last active January 26, 2020 13:39
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 bardiarastin/ec748dabd6eac004fcfa98e837b4f9d3 to your computer and use it in GitHub Desktop.
Save bardiarastin/ec748dabd6eac004fcfa98e837b4f9d3 to your computer and use it in GitHub Desktop.
import 'package:redux_example/src/redux/posts/posts_actions.dart';
import 'package:redux_example/src/redux/posts/posts_state.dart';
postsReducer(PostsState prevState, SetPostsStateAction action) {
final payload = action.postsState;
return prevState.copyWith(
isError: payload.isError,
isLoading: payload.isLoading,
posts: payload.posts,
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment