Skip to content
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

feat(core): allow removal of previously registered DestroyRef callbacks #49493

Conversation

pkozlowski-opensource
Copy link
Member

This change makes it possible to remove a previously registered destroy callback - to do so it is enough to call the unregistration function returned from the onDestroy method call.

@pkozlowski-opensource pkozlowski-opensource added the area: core Issues related to the framework runtime label Mar 20, 2023
@ngbot ngbot bot added this to the Backlog milestone Mar 20, 2023
@angular-robot angular-robot bot added the detected: feature PR contains a feature commit label Mar 20, 2023
@pkozlowski-opensource pkozlowski-opensource added the action: review The PR is still awaiting reviews from at least one requested reviewer label Mar 20, 2023
@pkozlowski-opensource pkozlowski-opensource marked this pull request as ready for review March 20, 2023 15:03
Copy link
Contributor

@atscott atscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: public-api, size-tracking

@pkozlowski-opensource pkozlowski-opensource force-pushed the destroy_ref_fn_removal branch 2 times, most recently from 91de568 to 3d38f02 Compare March 20, 2023 17:12
Copy link
Contributor

@AndrewKushnir AndrewKushnir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Just left a few minor comments, but none of them are blocking.

packages/core/src/di/r3_injector.ts Outdated Show resolved Hide resolved
packages/core/src/linker/destroy_ref.ts Outdated Show resolved Hide resolved
packages/core/src/linker/destroy_ref.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@jessicajaniuk jessicajaniuk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

reviewed-for: public-api

@alxhub alxhub added the target: minor This PR is targeted for the next minor release label Mar 20, 2023
Copy link
Member

@alxhub alxhub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-for: public-api

@pkozlowski-opensource pkozlowski-opensource removed the request for review from dylhunn March 21, 2023 07:42
@pkozlowski-opensource pkozlowski-opensource added action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Mar 21, 2023
@pkozlowski-opensource pkozlowski-opensource force-pushed the destroy_ref_fn_removal branch 2 times, most recently from 828a369 to 382cd04 Compare March 21, 2023 10:57
@pkozlowski-opensource pkozlowski-opensource added action: merge The PR is ready for merge by the caretaker and removed action: cleanup The PR is in need of cleanup, either due to needing a rebase or in response to comments from reviews labels Mar 21, 2023
@pkozlowski-opensource pkozlowski-opensource force-pushed the destroy_ref_fn_removal branch 2 times, most recently from d7379c3 to 716635c Compare March 21, 2023 14:42
This change makes it possible to remove a previously registered destroy
callback - to do so it is enough to call the unregistration function
returned from the onDestroy method call.
@pkozlowski-opensource
Copy link
Member Author

This PR was merged into the repository by commit d1617c4.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Apr 21, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants