We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Promise middleware is a redux middleware that allows:
function myAction() { return { payload: { promise: fetch('/api/something').then(res => res.json()), }, type: 'SOMETHING', }; }
Instead of:
function myAction() { return ({ dispatch }) => { dispatch({ type: 'SOMETHING_START' }); fetch('/api/something').then(res => res.json()).then( (json) => dispatch({ type: 'SOMETHING_SUCCESS', payload: json }), (err) => dispatch({ type: 'SOMETHING_ERROR', payload: err }) ); }; }
The text was updated successfully, but these errors were encountered:
It allows DRYer promise based code.
Sorry, something went wrong.
Add middleware for logging and promise handling
d3415c0
Adds optional `redux-logger` support and the promise-middleware. This closes #38.
9494447
yamadapc
No branches or pull requests
Promise middleware is a redux middleware that allows:
Instead of:
The text was updated successfully, but these errors were encountered: