-
Notifications
You must be signed in to change notification settings - Fork 145
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
Multiple .then calls will only fire the last .then callback #20
Comments
Hi @banderso-n! This is the expected behaviour (for now). Feel free to send a pull request =) |
@fdaciuk what are your thoughts on just using native promises? |
I think so =) But I think it will be better if something like babel promise plugin is used instead. What do you think about it? |
I vote for the simple route of assuming the native Promise global exists. It's available on every modern platform and most polyfills support creating a global if necessary. Using the babel plugin would force users into |
Make sense, but that's not enough =) I thought in create a mini library, based on Promise/A+ spec to solve this. |
If they don't have a promise polyfill included and they have to support legacy environments without native Promises built in then they should use a polyfill. There shouldn't be a need to create another promise library, there are already quite a few popular choices: https://github.com/stefanpenner/es6-promise If ajax were to pick a promise library (or create its own), then users of a different promise library would need to have 2 promise libraries loaded. By assuming a Promise global (or possibly passing in an option to |
Opened #38 as a discussion point. |
the non-standard promise almost ruined my project... |
@kenberkeley what did you end up doing/using instead? |
@fabiocbinbutter wrap with the native promise... |
I have two modules that call .then on the promise returned from an
ajax().post
call.Only the last callback "registered" with a
then
call will be invoked. As this is promise-based, I expect to be able to chain then/catch/always calls.The text was updated successfully, but these errors were encountered: