Using thunks in mapDispatchToProps
<p>I'm wondering how to use async action creators in <code>mapDispatchToProps</code> for <code>react-redux</code>'s <code>connect</code>. I'm using the <code>redux-thunk</code> middleware and the following is my <code>mapDispatchToProps</code>:</p>

<pre><code>function mapDispatchToProps(dispatch) {
    return {
        foo: function() {
            dispatch(someAction());

            return function asyncAction(dispatch, getState) {
                console.log("An async action!");
                dispatch(someOtherAction(getState().foo));
            };
        }
    }
}
</code></pre>

<p>However, when I do the above, the async action does not get executed. What is the correct way to do this?</p>