Understanding compose functions in redux : <p>I was trying to create a store in redux for which I am currently using following syntax:-</p>

<pre><code>const middlewares = [
  thunk,
  logger
]

const wlStore = createStore(
  rootReducer,
  initialState
  compose(applyMiddleware(...middlewares))
)
</code></pre>

<p>The above works fine for me and I can access the store, but I lately I bumped into another syntax:-</p>

<pre><code>const wlStore=applyMiddleware(thunk,logger)(createStore)(rootReducer)
</code></pre>

<p>Both of them seem to be doing the same job.</p>

<p>Is there any reason because of which I should prefer one over another? Pros/Cons?</p>
