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

Remove promise duplication. #117

Merged
merged 1 commit into from
Aug 1, 2016
Merged

Conversation

monder
Copy link
Collaborator

@monder monder commented Jul 27, 2016

Fixes #116

It may not seems obvious with all stuff happening with promises in react-router but methods do not mutate those.
e.g.

let a = new Promise(...)
let b = a.then(...)
let c = a.then(...)

b and c are completely different. And if the exception will be thrown in a there will be 2 unhanded ones.

We should either always handle promises without breaking the chain, or wrap every split with a catch block. This PR implements the 1st option.

@ericclemmons
Copy link
Owner

@monder Good catch! The examples still work as well?

@ericclemmons ericclemmons self-assigned this Jul 28, 2016
@monder
Copy link
Collaborator Author

monder commented Jul 28, 2016

The example for react-0.14 works just as before.
Tests pass.
It works on my app with react 15 as well.

@monder monder mentioned this pull request Jul 28, 2016
@monder monder merged commit dcb4d92 into ericclemmons:master Aug 1, 2016
@ekmartin
Copy link

ekmartin commented Aug 1, 2016

Thanks @monder!

@ekmartin
Copy link

ekmartin commented Aug 1, 2016

Would be nice if you could publish a new version when you have time @ericclemmons 😃

@monder
Copy link
Collaborator Author

monder commented Aug 1, 2016

Just published the version 3.0.3

@ekmartin
Copy link

ekmartin commented Aug 1, 2016

Great, thanks! Works like a charm.

@ericclemmons
Copy link
Owner

@monder What's your Twitter name? I want to broadcast the work you're doing :)

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

Successfully merging this pull request may close these issues.

3 participants