Ejemplo n.º 1
0
 /// <summary>
 /// Replaces the reducer currently used by the store to calculate the state.
 /// </summary>
 /// <remarks>
 /// This might be useful for implementing hot reloading, dynamically built reducers, and/or alternating the behaviours of reducers.
 /// </remarks>
 public void ReplaceReducer(ReducerDelegate <TState> reducer)
 {
     this.reducer = reducer;
 }
Ejemplo n.º 2
0
 public Reducer <TState> On <TAction>(ReducerDelegate <TState, TAction> reducer)
 {
     Add(typeof(TAction), new DelegatingReducer <TState, TAction>(reducer));
     return(this);
 }
Ejemplo n.º 3
0
 public Store(ReducerDelegate <TState> reducer, TState initialState = default(TState), params MiddlewareDelegate <TState>[] middlewares)
 {
     this.reducer    = reducer;
     this.dispatcher = ApplyMiddlewares(middlewares);
     this.state      = initialState;
 }