/// <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; }
public Reducer <TState> On <TAction>(ReducerDelegate <TState, TAction> reducer) { Add(typeof(TAction), new DelegatingReducer <TState, TAction>(reducer)); return(this); }
public Store(ReducerDelegate <TState> reducer, TState initialState = default(TState), params MiddlewareDelegate <TState>[] middlewares) { this.reducer = reducer; this.dispatcher = ApplyMiddlewares(middlewares); this.state = initialState; }