React and Redux: redirect after action : <p>I develop a website with React/Redux and I use a thunk middleware to call my API. My problem concerns redirections after actions.</p>

<p>I really do not know how and where I can do the redirection: in my action, in the reducer, in my component, … ?</p>

<p>My action looks like this:</p>

<pre><code>export function deleteItem(id) {
    return {
        [CALL_API]: {
            endpoint: `item/${id}`,
            method: 'DELETE',
            types: [DELETE_ITEM_REQUEST, DELETE_ITEM_SUCCESS, DELETE_ITEM_FAILURE]
        },
        id
    };
}
</code></pre>

<p><code>react-redux</code> is already implemented on my website and I know that I can do as below, but I do not want to redirect the use if the request failed:</p>

<pre><code>router.push('/items');
</code></pre>

<p>Thanks!</p>
