erikras / erikras/react-redux-universal-hot-example

Improvement idea: bubble errors from clientMiddleware

Open
#359 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
12.1k
Forks
2.5k
PR merge metrics
No merged PRs in 30d

Description

See comparison: (Edit: link was here, but whoops, I force-pushed over my master branch)

First, I changed `next` to `dispatch` within the promise callbacks. Doesn't seem necessary to call `next` in these contexts. Am I wrong?

Next, by default we will just swallow errors and return them as success by default. But, if you pass in `bubbleErrors: true`, instead the promise will throw, and you can catch as in my example.

This is useful for cases where you'd want to grab an error and display in a special way, such as calling `dispatch` to send it to a global error component.

Thoughts?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.