Skip to content

fix(core): allow toSignal calls in reactive context (#51831)#51892

Closed
pkozlowski-opensource wants to merge 1 commit intoangular:16.2.xfrom
pkozlowski-opensource:PR_51831_for_16_2
Closed

fix(core): allow toSignal calls in reactive context (#51831)#51892
pkozlowski-opensource wants to merge 1 commit intoangular:16.2.xfrom
pkozlowski-opensource:PR_51831_for_16_2

Conversation

@pkozlowski-opensource
Copy link
Member

This is a cherry pick of #51831 to the 16.2 branch

This PR moves the Observable subscription of toSignal outside of the
reactive context. As the result the toSignal calls are allowed in the
computed, effect and all other reactive consumers.

This is based on the reasoning that we already allow signals creation
in a reactive context. Plus a similar change was done to the async pipe
in the angular#50522

Fixes angular#51027
@pkozlowski-opensource pkozlowski-opensource added action: review The PR is still awaiting reviews from at least one requested reviewer area: core Issues related to the framework runtime labels Sep 25, 2023
@ngbot ngbot bot modified the milestone: Backlog Sep 25, 2023
@pkozlowski-opensource pkozlowski-opensource added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note and removed action: review The PR is still awaiting reviews from at least one requested reviewer merge: caretaker note Alert the caretaker performing the merge to check the PR for an out of normal action needed or note labels Sep 26, 2023
@dylhunn
Copy link
Contributor

dylhunn commented Sep 27, 2023

This PR was merged into the repository by commit 39a3e34.

@dylhunn dylhunn closed this Sep 27, 2023
dylhunn pushed a commit that referenced this pull request Sep 27, 2023
This PR moves the Observable subscription of toSignal outside of the
reactive context. As the result the toSignal calls are allowed in the
computed, effect and all other reactive consumers.

This is based on the reasoning that we already allow signals creation
in a reactive context. Plus a similar change was done to the async pipe
in the #50522

Fixes #51027

PR Close #51892
@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 Oct 28, 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 target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments