built_redux library

Classes

AbstractReducerBuilder<AState, AStateBuilder>
AbstractReducerBuilder returns a reducer builder that rebuilds an abstract, or mixed in, piece of state. For most cases AbstractReducerBuilder is not recommended. When defining your state model favor composition over inheritance. However, this may be useful when trying to share functionaity between two separate redux stores.
Action<Payload>
Action is the object passed to your reducer to signify the state change that needs to take place. Action names should always be unique. Uniqeness is guarenteed when using ReduxActions.
ActionDispatcher<P>
ActionDispatcher dispatches an action with the name provided to the constructor and the payload supplied when called. You will notice ActionDispatcher is an object, however it is to be used like a function. In the following example increment is an action dispatcher, that when called dispatches an action to the redux store with the name increment and the payload 3.
ActionName<T>
ActionName is an object that simply contains the action name but is typed with a generic that is the same as the relative ActionDispatchers payload generic. This allows you to declare reducer handlers with safety without having to instantiate your instance of ReduxActions.
ListMultimapReducerBuilder<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, K, V>
ListMultimapReducerBuilder returns a reducer builder that rebuilds a ListMultimap nested within the state tree
ListReducerBuilder<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, T>
ListReducerBuilder returns a reducer builder that rebuilds a List nested within the state tree
MapReducerBuilder<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, K, V>
MapReducerBuilder returns a reducer builder that rebuilds a Map nested within the state tree
MiddlewareApi<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, Actions extends ReduxActions>
MiddlewareApi put in scope to your Middleware function by redux. When using MiddlewareBuilder (recommended) MiddlewareApi is passed to your MiddlewareHandler
MiddlewareBuilder<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, Actions extends ReduxActions>
MiddlewareBuilder allows you to build a reducer that handles many different actions with many different payload types, while maintaining type safety. Each MiddlewareHandler added with add
NestedMiddlewareBuilder<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, Actions extends ReduxActions, NestedState extends Built<NestedState, NestedStateBuilder>, NestedStateBuilder extends Builder<NestedState, NestedStateBuilder>, NestedActions extends ReduxActions>
NestedReducerBuilder<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, NestedState extends Built<NestedState, NestedStateBuilder>, NestedStateBuilder extends Builder<NestedState, NestedStateBuilder>>
NestedReducerBuilder allows you to build a reducer that rebuilds built values nested within your main app state model. For example, consider the following built value
ReducerBuilder<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>>
ReducerBuilder allows you to build a reducer that handles many different actions with many different payload types, while maintaining type safety. Each Reducer added with add
ReduxActions
ReduxActions is a container for all of your applications actions.
SetMultimapReducerBuilder<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, K, V>
SetMultimapReducerBuilder returns a reducer builder that rebuilds a SetMultimap nested within the state tree
SetReducerBuilder<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, T>
SetReducerBuilder returns a reducer builder that rebuilds a Set nested within the state tree
Store<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, Actions extends ReduxActions>
Store is the container of your state. It listens for actions, invokes reducers, and publishes changes to the state
StoreChange<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, P>
StoreChange is the payload for the Store subscription
StoreChangeHandlerBuilder<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, Actions extends ReduxActions>
StoreChangeHandlerBuilder allows you to listen to the Store and perform handlers for a given set of actions with many different payload types, while maintaining type safety. Each StoreChangeHandler added with add
SubstateChange<Substate>
SubstateChange is the payload for StateChangeTransformer's stream. It contains the previous and next value of the state resulting from the mapper provided to StateChangeTransformer

Typedefs

ActionHandler = void Function(Action a)
ActionHandler handles an action, this will contain the actual middleware logic
CReducer<AState, AStateBuilder, P> = void Function(AState state, Action<P> action, AStateBuilder builder)
This is the Reducer typedef without the Built/Builder constraints Used for built_collections since they do not implement Built/Builder but follow the same pattern.
Dispatcher<P> = void Function(Action<P> action)
Mapper<State, NestedState> = NestedState Function(State state)
Mapper is a function that takes an object and maps it to another object. Used for state and builder mappers passed to NestedReducerBuilder.
Middleware<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, Actions extends ReduxActions> = NextActionHandler Function(MiddlewareApi<State, StateBuilder, Actions> api)
Middleware is a function that given the store's MiddlewareApi returns a NextActionHandler.
MiddlewareHandler<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, Actions extends ReduxActions, Payload> = void Function(MiddlewareApi<State, StateBuilder, Actions> api, ActionHandler next, Action<Payload> action)
MiddlewareHandler is a function that handles an action in a middleware. Its is only for use with MiddlewareBuilder. If you are not using MiddlewareBuilder middleware must be declared as a Middleware function.
NextActionHandler = ActionHandler Function(ActionHandler next)
NextActionHandler takes the next ActionHandler in the middleware chain and returns an ActionHandler for the middleware
Reducer<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, Payload> = void Function(State state, Action<Payload> action, StateBuilder builder)
Reducer is a function that given a state of type V, an Action of type Action
StateMapper<State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>, Substate> = Substate Function(State state)
StateMapper takes a state model and maps it to the values one cares about
StoreChangeHandler<P, State extends Built<State, StateBuilder>, StateBuilder extends Builder<State, StateBuilder>> = void Function(StoreChange<State, StateBuilder, P> storeChange)
StoreChangeHandler handles a change the store after an action of type Action