-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
fix(zone.js): support addEventListener with signal option. #49595
Conversation
ff8c0b6
to
63daf54
Compare
63daf54
to
3001611
Compare
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.
I think this design isn't satisfactory (if this were merged, I would probably patch it back to my "just backoff entirely when a signal is passed in" mode).
But I think it is better than the status quo, so I am approving for the sake of incremental improvement.
1a45a55
to
8a51837
Compare
I believe you've fixed the memory leaks, so this is looking good. I'm still not sure if something can be done about |
@JiaLiPassion @dylhunn @AndrewKushnir ? Is this fixed? |
@JiaLiPassion @DavidANeil Would there be anything where I can support this PR? |
@JiaLiPassion @DavidANeil As @jeripeierSBB mentioned; Is there any way to help? With the wider usage of AbortController in the web, the lack of support in zone.js is an intransparent error for consumers, that have no idea why specific code fails. |
I will check this one this week, thanks. |
@JiaLiPassion Thank you very much. I apologize for being pushy. |
8a51837
to
3d06423
Compare
Close angular#49591 ``` const ac = new AbortController(); addEventListener(eventName, handler, {signal: ac.signal);` ac.abort(); ``` Currently `zone.js` doesn't support the `signal` option, this PR allows the user to use AbortContoller to remove the event listener.
3d06423
to
da86d24
Compare
1c4f3cc
to
9a302a3
Compare
fetch support AbortSignal, zone.js schedules a macroTask when fetch() ``` fetch(..., {signal: abortSignal}); ``` we should also be able to cancel fetch with `zoneTask.cancel` call. So this commit create an internal AbortSignal to handle `zoneTask.cancel()` call and also delegate the `options.signal` from the user code.
9a302a3
to
eb5ef9a
Compare
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.
LGTM
This PR was merged into the repository by commit b06b24b. |
fetch support AbortSignal, zone.js schedules a macroTask when fetch() ``` fetch(..., {signal: abortSignal}); ``` we should also be able to cancel fetch with `zoneTask.cancel` call. So this commit create an internal AbortSignal to handle `zoneTask.cancel()` call and also delegate the `options.signal` from the user code. PR Close #49595
fetch support AbortSignal, zone.js schedules a macroTask when fetch() ``` fetch(..., {signal: abortSignal}); ``` we should also be able to cancel fetch with `zoneTask.cancel` call. So this commit create an internal AbortSignal to handle `zoneTask.cancel()` call and also delegate the `options.signal` from the user code. PR Close #49595
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…9595) Close angular#49591 ``` const ac = new AbortController(); addEventListener(eventName, handler, {signal: ac.signal);` ac.abort(); ``` Currently `zone.js` doesn't support the `signal` option, this PR allows the user to use AbortContoller to remove the event listener. PR Close angular#49595
fetch support AbortSignal, zone.js schedules a macroTask when fetch() ``` fetch(..., {signal: abortSignal}); ``` we should also be able to cancel fetch with `zoneTask.cancel` call. So this commit create an internal AbortSignal to handle `zoneTask.cancel()` call and also delegate the `options.signal` from the user code. PR Close angular#49595
…9595) Close angular#49591 ``` const ac = new AbortController(); addEventListener(eventName, handler, {signal: ac.signal);` ac.abort(); ``` Currently `zone.js` doesn't support the `signal` option, this PR allows the user to use AbortContoller to remove the event listener. PR Close angular#49595
fetch support AbortSignal, zone.js schedules a macroTask when fetch() ``` fetch(..., {signal: abortSignal}); ``` we should also be able to cancel fetch with `zoneTask.cancel` call. So this commit create an internal AbortSignal to handle `zoneTask.cancel()` call and also delegate the `options.signal` from the user code. PR Close angular#49595
…9595) Close angular#49591 ``` const ac = new AbortController(); addEventListener(eventName, handler, {signal: ac.signal);` ac.abort(); ``` Currently `zone.js` doesn't support the `signal` option, this PR allows the user to use AbortContoller to remove the event listener. PR Close angular#49595
fetch support AbortSignal, zone.js schedules a macroTask when fetch() ``` fetch(..., {signal: abortSignal}); ``` we should also be able to cancel fetch with `zoneTask.cancel` call. So this commit create an internal AbortSignal to handle `zoneTask.cancel()` call and also delegate the `options.signal` from the user code. PR Close angular#49595
…9595) Close angular#49591 ``` const ac = new AbortController(); addEventListener(eventName, handler, {signal: ac.signal);` ac.abort(); ``` Currently `zone.js` doesn't support the `signal` option, this PR allows the user to use AbortContoller to remove the event listener. PR Close angular#49595
fetch support AbortSignal, zone.js schedules a macroTask when fetch() ``` fetch(..., {signal: abortSignal}); ``` we should also be able to cancel fetch with `zoneTask.cancel` call. So this commit create an internal AbortSignal to handle `zoneTask.cancel()` call and also delegate the `options.signal` from the user code. PR Close angular#49595
Close #49591
Currently
zone.js
doesn't support thesignal
option, this PR allows the user to use AbortContoller to remove the event listener.