How do I update an Immutable array in a React/Redux environment?
<p>I have a React application that I'm using Redux to manage state.  I have the reducer working correctly, and I've successfully, passed the action and data I need. The problem is, up to this point, I've only worked with strings, so I've been using the <code>.set</code> method to update the state.</p>

<p>Now, I need to update an array by a specific index number, but I'm not having any luck. </p>

<p>Through my research, I've tried utilizing the <code>.update</code> method, but that's not working for me either. Another solution suggested mapping the state and modifying the index number, but that seemed a bit overkill.</p>

<p>Here is what I have for my state object:</p>

<pre><code>const initialState = fromJS({
    items: []
});
</code></pre>

<p>Through a <code>componentWillMount</code> function, I populate the items array using an AJAX call successfully by calling <code>state.set('items', action.items);</code></p>

<p>Now, I can't figure out how to update a single item in that array by an index number. I was able to get the index number using Immutable, but I don't know how to properly update the single array object. </p>

<p>My reducer is setup like so:</p>

<pre><code>function reducerName(state = initialState, action) {
    switch(action.type) {
        case TOGGLE_COMPLETED:
            let index = state.get('items').findIndex( (item) =&gt; { return item.id === action.reminder_id});
            return state
                .setIn(['items', index, 'completed'], true)
    }
}
</code></pre>

<p>Any ideas on how I can update a single index within the array instead of the entire array?</p>