Skip to content

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

Closed
pkozlowski-opensource wants to merge 1 commit intoangular:mainfrom
pkozlowski-opensource:issue_51027
Closed

fix(core): allow toSignal calls in reactive context#51831
pkozlowski-opensource wants to merge 1 commit intoangular:mainfrom
pkozlowski-opensource:issue_51027

Conversation

@pkozlowski-opensource
Copy link
Copy Markdown
Member

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

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 target: patch This PR is targeted for the next patch release core: reactivity Work related to fine-grained reactivity in the core framework labels Sep 20, 2023
@ngbot ngbot bot modified the milestone: Backlog Sep 20, 2023
@pkozlowski-opensource pkozlowski-opensource added action: merge The PR is ready for merge by the caretaker target: minor This PR is targeted for the next minor release and removed action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Sep 20, 2023
@pkozlowski-opensource
Copy link
Copy Markdown
Member Author

Re-targetting as minor since it doesn't merge cleanly to 16.2.x - will create a patch version of it when this PR lands.

@dylhunn
Copy link
Copy Markdown
Contributor

dylhunn commented Sep 22, 2023

This PR was merged into the repository by commit dcf18dc.

@dylhunn dylhunn closed this in dcf18dc Sep 22, 2023
pkozlowski-opensource added a commit to pkozlowski-opensource/angular that referenced this pull request Sep 25, 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 angular#50522

Fixes angular#51027
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
Copy Markdown

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 23, 2023
ChellappanRajan pushed a commit to ChellappanRajan/angular that referenced this pull request Jan 23, 2024
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

PR Close angular#51831
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 core: reactivity Work related to fine-grained reactivity in the core framework target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error NG0601 is reported incorrectly (triggered by NG0600) when calling toSignal inside a computed or effect

3 participants