Skip to content

Instantly share code, notes, and snippets.

@juliuscanute
Created December 14, 2019 22:12
Show Gist options
  • Select an option

  • Save juliuscanute/d6c8fba95532abc992cc4652d3ed7b01 to your computer and use it in GitHub Desktop.

Select an option

Save juliuscanute/d6c8fba95532abc992cc4652d3ed7b01 to your computer and use it in GitHub Desktop.
Create a new state from loaded emotions
final emotionAppReducer = combineReducers<EmotionAppState>([
TypedReducer<EmotionAppState, LoadedEmotions>(_handleLoadedEmotions)
]);
EmotionAppState _handleLoadedEmotions(
EmotionAppState previousState, LoadedEmotions action) {
EmotionAppState state;
state = previousState.copy(
newState: EmotionAppState(details: action.details, loadComplete: true));
return state;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment