title: Redux enhancer example
body: <p>I am new to redux. I would like know how I could create my own enhancer in redux. I didn't find any example to create <strong>enhancer</strong>. To create enhancers, So what arguments do I need to pass and what do I need to return? Is there any rule on creating custom enhancer?</p>
  <p>In redux documentation about enhancer, found below two links (no sample or example code)</p>
  <ul>
  <li><a href="https://redux.js.org/understanding/thinking-in-redux/glossary#store-enhancer" rel="noreferrer">store-enhancer</a></li>
  <li><a href="https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers" rel="noreferrer">using store enhancer</a></li>
  </ul>
  <p>Redux documentation said that,</p>
  <blockquote>
  <p>Middleware adds extra functionality to the Redux dispatch function; enhancers add extra functionality to the Redux store. ... A middleware which logs dispatched actions and the resulting new state. An enhancer which logs the time taken for the reducers to process each action.</p>
  </blockquote>
  <p>So, I am not sure that custom middleware and custom enhancer coding rule are the same like below</p>
  <pre><code>const loggerMiddleware = storeAPI =&gt; next =&gt; action =&gt; {
    console.log('dispatching', action)
    let result = next(action)
    console.log('next state', storeAPI.getState())
    return result
  }
  </code></pre>
  <p>So, my question is <em><strong>how to create custom enhancer?</strong></em></p>