public ReduxGrainState <TState> Execute(ReduxGrainState <TState> previous, IAction action) { var nextState = this.reducer(previous.State, action); var nextSerial = previous.Serial + 1; var next = new ReduxGrainState <TState>(nextState, nextSerial); next.UnsavedActions.Add(new TableStorableAction(DateTimeOffset.UtcNow, nextSerial, action)); return(next); }
public ReduxGrainStore(Reducer <TState> reducer, ReduxGrainState <TState> initialState, params Middleware <TState>[] middlewares) : base(new ReduxGrainReducer <TState>((s, a) => reducer(s, a)).Execute, initialState) { }