refractEnhancer (Redux)
Used to enhance a Redux store, adding observable functionality which can be used inside Refract.
Packages
refractEnhancer
is provided by our Redux packages - refract-redux-callbag
, refract-redux-most
, refract-redux-rxjs
, and refract-redux-xstream
.
Signature
Arguments
options
(object): an object which configures the Refract store enhancer.Two options are currently available for the
refractEnhancer
:eventsPrefix
(string): defines an actionType prefix which marks actions which are not intended to be forwarded to your reducers. Refract will intercept these, preventing them from touching your state (or any downstream store enhancers), but will forward them on to any watching apertures. (default:@@event/
)methodName
(string): customises the name used for thestore.observe
method. (default:observe
)Note that customising the
methodName
option with TypeScript will break the ReduxStore
interface, which is extended when you import the Refract enhancer. To use this option with TypeScript, you will need to extend the interface - for example:
Returns
StoreCreator
(Redux store creator): a function which creates a redux store. Note that you should not be calling this function directly, and instead should be passing it into Redux createStore
.
Example
Last updated