Writing Redux store enhancers

A Redux store enhancer is a higher-order function that takes a store creator function and returns a new enhanced store creator function. The createStore method is a store creator which has the following signature:

createStore = (reducer, preloadedState, enhancer) => Store 

While a store enhancer function has the following signature:

enhancer = (...optionalArguments) => ( 
createStore => (reducer, preloadedState, enhancer) => Store 
) 

It may look a bit difficult to understand now, but you don't really have to worry if you don't get it at first because you will probably never need to write a store enhancer. The purpose of this recipe was simply to help you to understand their purpose in a very simple way.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.7.174