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
then
Promise.prototype.then
This makes overriden thens govern the behavior of a promise, e.g.
const p = new Promise(() => {}); p.then = f => f(5); Promise.all([p]).then(([x]) => console.log(x)); // logs 5
This forces implementations to make an observable call to then instead of using internal mechanisms. I imagine this will not actually be a burden.
This does not impact Promise.resolve yet, i.e.
Promise.resolve
const p = new Promise(r => r(1)); p.then = f => f(2); Promise.resolve(p).then(x => console.log(x)); // still logs 1 right now
for that, see Make Resolve operate the same on promises and thenables, using then #54.
The text was updated successfully, but these errors were encountered:
@erights would appreciate your feedback before I implement this change; assigning to you.
Sorry, something went wrong.
assigning to you
accepted. Need to think about this. I will point out that
p.then = ....
fails if p is frozen. If the assignment is in strict code, it fails noisily.
422d131
erights
No branches or pull requests
Proposal
Promise.prototype.then
method definition.then
method.Observable Changes
This makes overriden
then
s govern the behavior of a promise, e.g.This forces implementations to make an observable call to
then
instead of using internal mechanisms. I imagine this will not actually be a burden.This does not impact
Promise.resolve
yet, i.e.for that, see Make Resolve operate the same on promises and thenables, using
then
#54.The text was updated successfully, but these errors were encountered: