An IStore
is instantiated as a Scoped dependency. Ultimately this is the root of everything for the current user.
When you inject IStore
, IState<Whatever>
IDispatcher
, IActionSubscriber
they will ultimately come from the state that is stored within that IStore
instance.
If you inject IStore into something you can iterate through its Features property, which is a dictionary of IFeature
keyed by name (the name being from IFeature.GetName
).
The IFeature has an object GetState()
method you can use to grab the state.
This is the non-generic way of accessing the state. The state is actually stored using generics.
Look at the ReduxDevTools code and you will see an example of how to get all state (to send to ReduxDevTools browser plugin) using IStore.Features
and GetState
https://github.com/mrpmorris/Fluxor/blob/master/Source/Fluxor.Blazor.Web.ReduxDevTools/ReduxDevToolsMiddleware.cs#L67
and in the OnJumpToState
method it shows how I restore historical states from the browser plugin
https://github.com/mrpmorris/Fluxor/blob/master/Source/Fluxor.Blazor.Web.ReduxDevTools/ReduxDevToolsMiddleware.cs#L92