Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The thunk middleware should return what the thunk returns #244

Closed
w9 opened this issue May 4, 2018 · 1 comment
Closed

The thunk middleware should return what the thunk returns #244

w9 opened this issue May 4, 2018 · 1 comment

Comments

@w9
Copy link

w9 commented May 4, 2018

According to this post, in the original redux-thunk middleware, the call:

const res = store.dispatch({ type: 'MY_THUNK' });

should return whatever is returned by the thunk function. This is especially important when the thunk function is async, as it returns a Promise, and allows for thunk chaining:

await store.dispatch({ type: 'MY_THUNK_1' });
await store.dispatch({ type: 'MY_THUNK_2' });

Right now, the thunk middleware in redux-first-router returns the action itself, which is almost never useful.

@w9 w9 changed the title The thunk middleware does not return what the thunk returns The thunk middleware should return what the thunk returns May 4, 2018
@faceyspacey
Copy link
Owner

This is addressed in the next major version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants