Loop to dispatch a reducer in Redux
<p>I have a <code>json</code> file with an array of Todos that I want to render as an initial state calling my reducer <code>type: 'ADD_TODO'</code>. Where is better to loop to <code>dispatch</code> the action:</p>

<p>Is better to loop in the Component, adding each single Todo, like:</p>

<pre><code>myInitialTodos.forEach(
  (todo, id) =&gt; store.dispatch({
    type: 'ADD_TODO',
    id
  })
)
</code></pre>

<p>or in another <code>reducer</code> composed with <code>ADD_TODO</code>, like:</p>

<pre><code>store.dispatch({
  type: 'ADD_TODOS',
  todos: myInitialTodos
})
</code></pre>

<p>In both cases, launching when <code>componentDidMount</code> (for example).</p>

<p>Maybe (and most probably) there is another and better way. </p>

<p>Thanks,</p>