Exemple #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;
 }
Exemple #2
0
 public Reducer <TState> On <TAction>(ReducerDelegate <TState, TAction> reducer)
 {
     Add(typeof(TAction), new DelegatingReducer <TState, TAction>(reducer));
     return(this);
 }
Exemple #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;
 }