astx-redux-util
The astx-redux-util library promotes several redux reducer composition utilities, which blend multiple reducers together forming a richer abstraction through functional decomposition (i.e. higher-order functions).
Reducer composition is not new. Redux itself provides the innovative combineReducers utility which allows you to fuse individual reducers together to build up the overall shape of your application state.
The most prevalent astx-redux-util utility is reducerHash()
,
which lets you combine sub-reducers in such a way as to eliminate
the switch statement commonly used to delineate action type.
Additionally, astx-redux-util promotes other reducer compositions that can be used in conjunction with one another.
At a Glance
Getting Started
... installation and access-
Basics
... usingreducerHash()
, eliminate the switch statement commonly found in reducers ("look ma, no switch")Conditional Reduction
... usingconditionalReducer()
, invoke a reducer only when certain constraints are met ("to reduce or NOT to reduce; that is the question")Joining Reducers
... usingjoinReducers()
, team up multiple reducers to promote higher order functionality ("working together is success" - Henry Ford)
A Most Excellent Example
... a more complete example employing many of the astx-redux-util utility functionsAPI Reference
... details the low-level functional APIoriginalReducerState
... a sidebar discussion of originalReducerStateExtending astx-redux-util
... how would one extend astx-redux-util?Logging Extension
... a concrete example of reducer-based centralized logging ("smarter logging")
Distribution
... where to find this utility (and a local copy of the docs)Why astx-redux-util?
... why was astx-redux-util created, and how does it compare to other utilitiesRevision History
... peruse various revisionsMIT License
... legal stuff