-
Notifications
You must be signed in to change notification settings - Fork 54
Don't require action within a Promise reaction microtask. #570
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @jan-ivar. I've left a bunch of suggestions for @martinthomson to review, and you're welcome to apply any that you agree with or make other changes in response, but we can also take it from here.
Co-authored-by: Jeffrey Yasskin <[email protected]>
If developer-supplied code needs to be able to call <code>event.{{Event/preventDefault()}}</code> | ||
or choose a response object with | ||
<code>fetchEvent.{{FetchEvent/respondWith()}}</code>, | ||
it needs to be a callback rather than a reaction passed to <code>Promise.{{Promise/then()}}</code>. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a good example or a bad one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's probably ingrained at this point. Whether it's a good pattern or not might be debatable. The last place I personally encountered it was https://w3c.github.io/webrtc-extensions/#dfn-icecandidatepairremove (though our motivation there was finding a manner of interfering with the ICE agent that the most people could stomach).
Co-authored-by: Martin Thomson <[email protected]>
Co-authored-by: Martin Thomson <[email protected]>
Thanks for all the feedback, this is looking much better! |
Co-authored-by: Jeffrey Yasskin <[email protected]>
SHA: 8b0f2a8 Reason: push, by martinthomson Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Fixes #342.
Preview (#sync-callbacks) (#promises-and-reacti…) | Diff