René's URL Explorer Experiment


Title: Add WritableComputed to allow computed with write operations · Issue #55673 · angular/angular · GitHub

Open Graph Title: Add WritableComputed to allow computed with write operations · Issue #55673 · angular/angular

X Title: Add WritableComputed to allow computed with write operations · Issue #55673 · angular/angular

Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Revival with use case of #50498 Currently signal produces a writable signal. Currently computed produces a non writable signal. What I am missing i...

Open Graph Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Revival with use case of #50498 Currently signal produces a writable signal. Currently computed produces a ...

X Description: Which @angular/* package(s) are relevant/related to the feature request? core Description Revival with use case of #50498 Currently signal produces a writable signal. Currently computed produces a ...

Opengraph URL: https://github.com/angular/angular/issues/55673

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Add WritableComputed to allow computed with write operations","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\n\ncore\n\n### Description\n\nRevival with use case of #50498\r\n\r\nCurrently `signal` produces a writable signal.\r\nCurrently `computed` produces a non writable signal.\r\nWhat I am missing is a `writableComputed`.\r\n\r\nUse case example:\r\nI have a required input called `value` but inside the component I can edit this value without affecting the outside. At the end an apply button is clicked and I emit the new value via an output.\r\nSomething like this:\r\n```ts\r\nclass Test {\r\n  value = input.required\u003cstring>();\r\n  tempValue = signal(/*??*/);\r\n  commit = output\u003cstring>()\r\n\r\n  onEdit(newValue: string) {\r\n    this.tempValue.set(newValue);\r\n  }\r\n\r\n  onApply() {\r\n    this.commit.emit(this.tempValue());\r\n  }\r\n}\r\n``` \r\nThe first problem is `tempValue` isn't based on `value`.\r\nThe second problem is when `value` is changed from outside. At this point I wish to discard  `tempValue` and start fresh with the new `value`.\r\nIf I had `writableComputed` I could do:\r\n```ts\r\ntempValue = writableComputed(() => this.value());\r\n```\r\nWhich means anytime `value` changes it becomes the new `tempValue` value. If `tempValue` is edited the new edit is the `tempValue` new value until something gets changed in `value`.\n\n### Proposed solution\n\nA new `writableComputed` which tracks the value inside based on the writeable part and will get reset each time the computed function runs to what it creates.\r\nExamples:\r\n```ts\r\nconst a = signal(7);\r\nconst b = writableComputed(() => a() + 1);\r\n// b is 8\r\n```\r\n```ts\r\nconst a = signal(7);\r\nconst b = writableComputed(() => a() + 1);\r\nb.set(9);\r\n// A design question - 8 or 9\r\n```\r\n```ts\r\nconst a = signal(7);\r\nconst b = writableComputed(() => a() + 1);\r\na.set(11);\r\nb.set(9);\r\n// A design question - 12 or 9\r\n```\r\n```ts\r\nconst a = signal(7);\r\nconst b = writableComputed(() => a() + 1);\r\n// b is 8\r\n// Later\r\nb.set(10)\r\n// b is 10\r\n// Later\r\na.set(20);\r\n// b is 21\r\n```\n\n### Alternatives considered\n\nUsing effect. The downside is with required inputs.\r\n```ts\r\ntempValue = signal\u003cstring | undefined>(undefined);\r\neffect(() => this.tempValue.set(this.value()), {allowSignalWrites: true});\r\n```\r\nThis will result in `tempValue` having `undefined` initially and for example in `ngOnInit` it will still have `undefined` although `value` already have the actual value set. Also a computed will have its value set too.\r\nusing `writableComputed` in `ngOnInit` will have the correct computed value.\r\n\r\nAnother option is that scenario hints that something I am doing is wrong from the basis and I would like to hear better suggestions how to handle it. ","author":{"url":"https://github.com/Harpush","@type":"Person","name":"Harpush"},"datePublished":"2024-05-04T13:46:02Z","url":"https://github.com/angular/angular/issues/55673"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:c8c689d9-921c-0747-9947-8e6ab26d1ac4
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8D7E:19E4BB:354A249:43FE3AA:6B01E890
html-safe-nonce93cbe7acdd21cbca435f68a1609df45be728d7789fe868974c01346f6939a26d
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDdFOjE5RTRCQjozNTRBMjQ5OjQzRkUzQUE6NkIwMUU4OTAiLCJ2aXNpdG9yX2lkIjoiMTk4OTY3NjM0NTQ3NTY2NzM2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac3bd1fbf79efe540321292338e8f2d49fb0561b432dc4e5b95797443890a213ab
hovercard-subject-tagissue:2279005463
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular/55673/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d59ae591ae207749a8bc80c2099f11c62eb870ab434c179ee885b9a646e4ad10/angular/angular/issues/55673
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d59ae591ae207749a8bc80c2099f11c62eb870ab434c179ee885b9a646e4ad10/angular/angular/issues/55673
og:image:altWhich @angular/* package(s) are relevant/related to the feature request? core Description Revival with use case of #50498 Currently signal produces a writable signal. Currently computed produces a ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameHarpush
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/angular/angular git https://github.com/angular/angular.git
octolytics-dimension-user_id139426
octolytics-dimension-user_loginangular
octolytics-dimension-repository_id24195339
octolytics-dimension-repository_nwoangular/angular
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id24195339
octolytics-dimension-repository_network_root_nwoangular/angular
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/angular/angular/issues/55673#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F55673
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F55673
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=angular%2Fangular
Reloadhttps://github.com/angular/angular/issues/55673
Reloadhttps://github.com/angular/angular/issues/55673
Reloadhttps://github.com/angular/angular/issues/55673
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests143 (143)https://github.com/angular/angular/pulls
Discussionshttps://github.com/angular/angular/discussions
Actionshttps://github.com/angular/angular/actions
Projectshttps://github.com/angular/angular/projects
Security and quality40 (40)https://github.com/angular/angular/security
Insightshttps://github.com/angular/angular/insights
https://github.com/angular/angular
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/55673
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/55673
Add WritableComputed to allow computed with write operationshttps://github.com/angular/angular/issues/55673#top
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: reactivityWork related to fine-grained reactivity in the core frameworkhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20reactivity%22
cross-cutting: signalshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22cross-cutting%3A%20signals%22
needsTriagehttps://github.com/angular/angular/milestone/83
https://github.com/Harpush
Harpushhttps://github.com/Harpush
on May 4, 2024https://github.com/angular/angular/issues/55673#issue-2279005463
#50498https://github.com/angular/angular/issues/50498
https://github.com/json-derulo
json-derulohttps://github.com/json-derulo
on May 4, 2024https://github.com/angular/angular/issues/55673#issuecomment-2094248583
https://github.com/Harpush
Harpushhttps://github.com/Harpush
on May 4, 2024https://github.com/angular/angular/issues/55673#issuecomment-2094253089
https://github.com/alxhub
alxhubhttps://github.com/alxhub
on May 4, 2024https://github.com/angular/angular/issues/55673#issuecomment-2094336791
https://github.com/JoostK
JoostKhttps://github.com/JoostK
on May 4, 2024https://github.com/angular/angular/issues/55673#issuecomment-2094350490
https://github.com/Harpush
Harpushhttps://github.com/Harpush
on May 4, 2024https://github.com/angular/angular/issues/55673#issuecomment-2094402647
@alxhubhttps://github.com/alxhub
@JoostKhttps://github.com/JoostK
alxhubhttps://github.com/alxhub
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: reactivityWork related to fine-grained reactivity in the core frameworkhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20reactivity%22
cross-cutting: signalshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22cross-cutting%3A%20signals%22
on May 6, 2024https://github.com/angular/angular/issues/55673#event-12721127418
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on May 6, 2024https://github.com/angular/angular/issues/55673#event-12721127609
https://github.com/mauriziocescon
mauriziocesconhttps://github.com/mauriziocescon
on Jul 15, 2024https://github.com/angular/angular/issues/55673#issuecomment-2229194833
once this PRhttps://github.com/angular/angular/pull/56501
https://stackblitz.com/edit/stackblitz-starters-bw7fmd?file=src%2Fmain.tshttps://stackblitz.com/edit/stackblitz-starters-bw7fmd?file=src%2Fmain.ts
https://github.com/eneajaho
eneajahohttps://github.com/eneajaho
on Jul 17, 2024https://github.com/angular/angular/issues/55673#issuecomment-2233687214
added PRhttps://github.com/ngxtension/ngxtension-platform/pull/459
https://github.com/mauriziocescon
mauriziocesconhttps://github.com/mauriziocescon
on Jul 17, 2024https://github.com/angular/angular/issues/55673#issuecomment-2234001758
https://github.com/pkozlowski-opensource
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
on Aug 14, 2024https://github.com/angular/angular/issues/55673#issuecomment-2288435547
originally exposed onehttps://github.com/angular/angular/issues/55673#issue-2279005463
#55673 (comment)https://github.com/angular/angular/issues/55673#issuecomment-2094350490
https://github.com/mauriziocescon
mauriziocesconhttps://github.com/mauriziocescon
on Aug 22, 2024https://github.com/angular/angular/issues/55673#issuecomment-2304674563
https://x.com/joyofcodedev/status/1825986171924525450https://x.com/joyofcodedev/status/1825986171924525450
https://github.com/mauriziocescon
mauriziocesconhttps://github.com/mauriziocescon
on Aug 22, 2024https://github.com/angular/angular/issues/55673#issuecomment-2305484632
https://github.com/mauriziocescon
mauriziocesconhttps://github.com/mauriziocescon
on Sep 17, 2024https://github.com/angular/angular/issues/55673#issuecomment-2355927171
TechStackNation video from Alex https://www.youtube.com/watch?v=aKxcIQMWSNU
https://stackblitz.com/edit/stackblitz-starters-bazylb?file=src%2Fmain.tshttps://stackblitz.com/edit/stackblitz-starters-bazylb?file=src%2Fmain.ts
#54339https://github.com/angular/angular/issues/54339
https://github.com/pkozlowski-opensource
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
on Sep 17, 2024https://github.com/angular/angular/issues/55673#issuecomment-2355978601
@mauriziocesconhttps://github.com/mauriziocescon
devversionhttps://github.com/devversion
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
8311f00https://github.com/angular/angular/commit/8311f00faaf282d1a5b1ddca29247a2fba94a692
on Oct 18, 2024https://github.com/angular/angular/issues/55673#event-14714667034
angular-robothttps://github.com/angular-robot
on Oct 18, 2024https://github.com/angular/angular/issues/55673#event-14715644247
feat(core): introduce the reactive linkedSignal (angular#58189)https://github.com/angular-robot/angular/commit/8311f00faaf282d1a5b1ddca29247a2fba94a692
angular#58189https://github.com/angular/angular/pull/58189
https://docs.github.com/articles/closing-issues-via-commit-messages
8311f00https://github.com/angular-robot/angular/commit/8311f00faaf282d1a5b1ddca29247a2fba94a692
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Nov 18, 2024https://github.com/angular/angular/issues/55673#issuecomment-2481693850
automatic conversation locking policyhttps://github.com/angular/angular/blob/f0fbced1c55bc8b8ed9df01cea99df42f3e7eae3/contributing-docs/auto-issue-locking.md
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Nov 18, 2024https://github.com/angular/angular/issues/55673#event-15326825405
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/55673
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/55673
area: coreIssues related to the framework runtimehttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22area%3A%20core%22
core: reactivityWork related to fine-grained reactivity in the core frameworkhttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22core%3A%20reactivity%22
cross-cutting: signalshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22cross-cutting%3A%20signals%22
needsTriageNo due datehttps://github.com/angular/angular/milestone/83
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.