public void Dispatch(TAction action) { lock (_syncRoot) { State = _rootReducer(State, action); _devToolsInterop.Log(action.ToString(), _options.StateSerializer(State)); History.Add(new HistoricEntry <TState, object>(State, action)); } OnChange(null); }
public Store(TState initialState, Reducer <TState, TAction> rootReducer, ReduxOptions <TState> options, IJSRuntime jsRuntime) { _initialState = initialState; _rootReducer = rootReducer; _options = options; State = initialState; DevToolsInterop.JSRuntime = jsRuntime; DevToolsInterop.Reset += OnDevToolsReset; DevToolsInterop.TimeTravel += OnDevToolsTimeTravel; DevToolsInterop.Log("initial", _options.StateSerializer(State)); History = new List <HistoricEntry <TState, object> > { new HistoricEntry <TState, object>(State) }; }