/// <see cref="IMiddleware.AfterDispatch(IAction)"/> public override void AfterDispatch(IAction action) { ReduxDevToolsInterop.Dispatch(action, GetState()); // As actions can only be executed if not in a historical state (yes, "a" historical, pronounce your H!) // ensure the latest is incremented, and the current = latest SequenceNumberOfLatestState++; SequenceNumberOfCurrentState = SequenceNumberOfLatestState; }
/// <summary> /// Creates a new instance of the middleware /// </summary> public ReduxDevToolsMiddleware(ReduxDevToolsInterop reduxDevToolsInterop) { ReduxDevToolsInterop = reduxDevToolsInterop; SerializationOptions = new JsonSerializerOptions { PropertyNameCaseInsensitive = true, WriteIndented = false }; ReduxDevToolsInterop.OnJumpToState = OnJumpToState; ReduxDevToolsInterop.OnCommit = OnCommit; }
private void OnCommit(object sender, EventArgs e) { ReduxDevToolsInterop.Init(GetState()); SequenceNumberOfCurrentState = SequenceNumberOfLatestState; }
public override void Initialize(IStore store) { base.Initialize(store); ReduxDevToolsInterop.Init(GetState()); }
public override string GetClientScripts() { return(ReduxDevToolsInterop.GetClientScripts()); }