-
-
Notifications
You must be signed in to change notification settings - Fork 329
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
Allow promises to have multiple then/rescue/always #1263
Conversation
👍 Master is already targeting 0.10 but if someone needs it individual commits/PRs can be backported to 0.9 and released in 0.9.1 |
If it works I'm fine with it, I just have one request, can you add |
According to the A+ promise specification, "then may be called multiple times on the same promise" -- https://promisesaplus.com/#point-36
619e8a4
to
eef5edb
Compare
I'm not sure what you mean. You want one that does raise if called multiple times on the same promise? |
Yes, alternative bang methods that raise. |
What was the reason behind the single-use method again? I've asked this before but I don't remember. |
I just personally prefer it that way to avoid bugs in the code when you only want to chain and not add up. |
Alrighty, done, but it looks like GitHub diffs are broken at the moment? |
I'll merge after they're back. |
Allow promises to have multiple then/rescue/always
According to the A+ promise specification, "
then
may be called multiple times on the same promise". Sincefail
andalways
are justthen
with different success/failure semantics, I added the same functionality to them, as well.@wied03, @meh, and I spoke about supporting this in the past. Last I heard, @meh was still contemplating the change. I probably should've put this in before the 0.9 release, but this PR is backwards-compatible with the current release.