title: createStore with combineReducers and applyMiddleware without second argument
body: <p>when using <code>createStore</code>, there are 1 argument needed and 2 optional arguments:</p>
  
  <ol>
  <li><p><code>reducer</code> (<em>Function</em>): A reducing function that returns the next state tree, given the current state tree and an action to handle.</p></li>
  <li><p><code>preloadedState</code> (<em>any</em>): The initial state. You may optionally specify it to hydrate the state from the server in universal apps, or to restore a previously serialized user session. If you produced <code>reducer</code> with combineReducers, this must be a plain object with the same shape as the keys passed to it. Otherwise, you are free to pass anything that your <code>reducer</code> can understand.</p></li>
  <li><p><code>enhancer</code> (<em>Function</em>): The store enhancer. You may optionally specify it to enhance the store with third-party capabilities such as middleware, time travel, persistence, etc. The only store enhancer that ships with Redux is <code>applyMiddleware()</code>.</p></li>
  </ol>
  
  <p>If we use <code>combineReducers</code> and <code>applyMiddleware()</code> together, it is available to omit second argument when using <code>createStore()</code>, like below:</p>
  
  <p>(In <a href="https://redux.js.org/api/applymiddleware#example-using-thunk-middleware-for-async-actions" rel="nofollow noreferrer">official doc's example</a>, same usage pattern is shown)</p>
  
  <pre class="lang-js prettyprint-override"><code>const modules = combineReducers(reducer1, reducer2)
  
  const store = createStore(modules, applyMiddleware(...middlewares))
  </code></pre>
  
  <p>How it is possible? <code>combineReducers</code> only returns a <code>function</code>. In the above example, can <code>createStore</code> know whether the second (and the last) parameter is the <em>store enhancer</em>, not <em>inisital state</em>?</p>