Private
Readonly
mapA mapSubReducers is a map of Reducers indexed by their hash signatures.
Private
rootHolding current root reducer
Private
cleanupComposes multiple reducers into a single reducer function and applies middleware to it.
The root reducer function to compose.
Optional
middlewares: Middleware<any, AnyAction>[] = []An array of middleware functions to apply.
Private
executePrivate
Executes the middleware chain for the current action and returns the new state.
The current state of the store.
The current action being dispatched.
An array of middlewares registered with the store.
Private
producePrivate
Produces a new state object based on the given base state object and an action object. Uses a Proxy object to allow for "draft" modifications to the state object, and return the cleaned-up state object without any Proxy objects after the modifications have been made.
If the state is not object
The cleaned-up state object after the modifications have been made.
The type of the state object.
The base state object to be modified.
The action object to be applied to the state.
The reducer function that applies the action to the draft state.
Registers a local sub reducer with the Fractal Reducer Registry under the specified hash signature. If a reducer is already registered under the same hash signature, the new reducer is not added.
The hash signature of the reducer to be registered.
The local reducer to be registered.
Replaces a registered sub-reducer with a new one based on the hash signature.
The hash signature of the registered sub-reducer.
The new sub-reducer to replace the existing one.
Private
subPrivate
The root reducer function for sub-stores.
If the sub-store state is not changed. If the sub-store state is changed, return the new state.
The current state of the sub-store.
The current action dispatched to the sub-store.
The next middleware to call.
Static
getReturns the single instance of the Singleton
class.
If the instance has not yet been created, a new instance is created and returned.
The single instance of the Singleton
class
Generated using TypeDoc
Service class for composing reducers and applying middleware to them.
Example