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

signal computed read/write function #50498

Closed
indraraj26 opened this issue May 28, 2023 · 5 comments
Closed

signal computed read/write function #50498

indraraj26 opened this issue May 28, 2023 · 5 comments
Labels
area: core Issues related to the framework runtime core: reactivity Work related to fine-grained reactivity in the core framework cross-cutting: signals needs: clarification This issue needs additional clarification from the reporter before the team can investigate.
Milestone

Comments

@indraraj26
Copy link

Which @angular/* package(s) are relevant/related to the feature request?

core

Description

we should able to update in computed function.

Proposed solution

https://knockoutjs.com/documentation/computed-writable.html

Alternatives considered

https://knockoutjs.com/documentation/computed-writable.html

@indraraj26 indraraj26 changed the title signal computed read/write signal computed read/write function May 28, 2023
@dylhunn dylhunn added the area: core Issues related to the framework runtime label May 31, 2023
@ngbot ngbot bot added this to the needsTriage milestone May 31, 2023
@pkozlowski-opensource pkozlowski-opensource added the core: reactivity Work related to fine-grained reactivity in the core framework label Jun 7, 2023
@pkozlowski-opensource
Copy link
Member

@indraraj26 we did discuss similar possibility for computed but didn't want to introduce new APIs without clear indication of a common use-cases.

Which brings me to the question: what would be use-cases that you are trying to solve?

@indraraj26
Copy link
Author

Examples are already available in the link. With this read/write you do not have to write separate listener for (change) then update signal

@pkozlowski-opensource
Copy link
Member

Examples are already available in the link.

Those are examples from knockoutjs so the context is different. I wanted to understand how it would make your life easier in the context of real-like Angular code.

With this read/write you do not have to write separate listener for (change) then update signal

Could you share a stackblitz with the exact scenario that makes you write more code that you would like?

@pkozlowski-opensource pkozlowski-opensource added the needs: clarification This issue needs additional clarification from the reporter before the team can investigate. label Jun 16, 2023
@pkozlowski-opensource
Copy link
Member

Again, I'm happy to explore the idea of computed signals that can be written to as well - given enough important use-cases. Going to close the issue for now but will keep an eye on the usage patters.

@pkozlowski-opensource pkozlowski-opensource closed this as not planned Won't fix, can't repro, duplicate, stale Jun 21, 2023
@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 Jul 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: core Issues related to the framework runtime core: reactivity Work related to fine-grained reactivity in the core framework cross-cutting: signals needs: clarification This issue needs additional clarification from the reporter before the team can investigate.
Projects
None yet
Development

No branches or pull requests

4 participants