Search⌘ K

Store Enhancers

Explore how to create and apply Redux store enhancers to extend store capabilities. Learn to persist state in localStorage, sync states across tabs, and integrate developer tools by writing higher-order functions that decorate createStore. Understand parameters and composing multiple enhancers to build robust Redux stores.

We'll cover the following...

Store enhancers are higher-order functions used to enhance the default behavior of the Redux store. In contrast to middleware and reducers, they have access to all internal store methods.

To give a few examples, there are store enhancers for:

  • Store synchronization (between browser tabs or even network clients)
  • State persistence
  • Integration with developer tools

Let’s build an example store enhancer that will persist state changes and load the initial state from localStorage. To enhance or decorate a store, we need to write a higher-order function that receives the ...