René's URL Explorer Experiment


Title: Allow `computed` computation function to access previous value · Issue #54339 · angular/angular · GitHub

Open Graph Title: Allow `computed` computation function to access previous value · Issue #54339 · angular/angular

X Title: Allow `computed` computation function to access previous value · Issue #54339 · angular/angular

Description: Which @angular/* package(s) are relevant/related to the feature request? core Description A long, interesting, and possibly unfinished discussion developed in sub-RFC 2 about signal APIs, pure functions, and hysteresis. Can, and should, ...

Open Graph Description: Which @angular/* package(s) are relevant/related to the feature request? core Description A long, interesting, and possibly unfinished discussion developed in sub-RFC 2 about signal APIs, pure func...

X Description: Which @angular/* package(s) are relevant/related to the feature request? core Description A long, interesting, and possibly unfinished discussion developed in sub-RFC 2 about signal APIs, pure func...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow `computed` computation function to access previous value","articleBody":"### Which @angular/* package(s) are relevant/related to the feature request?\n\ncore\n\n### Description\n\nA long, interesting, and possibly unfinished [discussion](https://github.com/angular/angular/discussions/49683#discussioncomment-5598532) developed in sub-RFC 2 about signal APIs, pure functions, and [hysteresis](https://github.com/angular/angular/discussions/49683#discussioncomment-5612162).\r\n\r\nCan, and should, `computed` computation functions have access to their previous computation's result?\r\n\r\nI haven't personally run into an use-case for this, and I don't have enough knowledge to post an opinion, but figured we could resurface this, whether it's to continue the discourse or for visibility into why it can't (or won't) be done.\r\n\r\nResources:\r\n- Sub-RFC 2: https://github.com/angular/angular/discussions/49683\r\n- Thread in RFC (again): https://github.com/angular/angular/discussions/49683#discussioncomment-5598532\r\n- Comment where @alxhub says this is \"worth considering\" 😬: https://github.com/angular/angular/discussions/49683#discussioncomment-5612162\r\n- SO question: https://stackoverflow.com/questions/77689615/is-there-a-way-to-use-the-previous-value-of-a-computed-angular-signal\r\n- `ngxtension-platform`'s since-deprecated `computedExtended`: https://github.com/nartc/ngxtension-platform/blob/main/libs/ngxtension/computed/src/computed.ts\n\n### Proposed solution\n\nPass the value to the computation function. I realize it's not as straightforward as this; I'm just trying to bring forth all the information I've gathered.\r\n\r\nhttps://github.com/angular/angular/blob/ca239e8b62017b8460d73e58085d0f1c53a642ff/packages/core/primitives/signals/src/computed.ts#L110-L117\r\n\r\n```ts\r\ntype SomeUnsetRepresentation = undefined; // or UNSET which is currently not exported?\r\nexport declare function computed\u003cT>(\r\n  computation: (previousValue: T | SomeUnsetRepresentation) => T, \r\n  options?: CreateComputedOptions\u003cT>\r\n): Signal\u003cT>;\r\n```\n\n### Alternatives considered\n\nLots of potential solutions were proposed in [that thread](https://github.com/angular/angular/discussions/49683#discussioncomment-5598532) of the sub-RFC but none are ideal. (using RxJS; delaying computed; tracking the values independently; etc.)","author":{"url":"https://github.com/rlmestre","@type":"Person","name":"rlmestre"},"datePublished":"2024-02-08T13:55:16Z","url":"https://github.com/angular/angular/issues/54339"}

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:dd9fcedf-3e78-79f0-8213-fc710524229c
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB17A:2E3FEE:38D6736:47FC7F8:6B01F026
html-safe-nonce38ff274e29fe47cadbcf22785b5677fab69cc095ba9d3339b2385cb29cf45074
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMTdBOjJFM0ZFRTozOEQ2NzM2OjQ3RkM3Rjg6NkIwMUYwMjYiLCJ2aXNpdG9yX2lkIjoiMjI4NDUxMjA5NDU4ODEwNDc0MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmace8ca7e7f34ff835c72619600d88225c236f2d276a3834930663428fef0d7a8c8
hovercard-subject-tagissue:2125244173
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/54339/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e8eb636aaecf078613ee11fc9bae1cca97267278a14b242c569099fe9213530e/angular/angular/issues/54339
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e8eb636aaecf078613ee11fc9bae1cca97267278a14b242c569099fe9213530e/angular/angular/issues/54339
og:image:altWhich @angular/* package(s) are relevant/related to the feature request? core Description A long, interesting, and possibly unfinished discussion developed in sub-RFC 2 about signal APIs, pure func...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamerlmestre
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/54339#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F54339
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%2F54339
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/54339
Reloadhttps://github.com/angular/angular/issues/54339
Reloadhttps://github.com/angular/angular/issues/54339
angularhttps://github.com/angular
angularhttps://github.com/angular/angular
Codehttps://github.com/angular/angular
Issues835 (835)https://github.com/angular/angular/issues
Pull requests142 (142)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/54339
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/54339
Allow computed computation function to access previous valuehttps://github.com/angular/angular/issues/54339#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/rlmestre
rlmestrehttps://github.com/rlmestre
on Feb 8, 2024https://github.com/angular/angular/issues/54339#issue-2125244173
discussionhttps://github.com/angular/angular/discussions/49683#discussioncomment-5598532
hysteresishttps://github.com/angular/angular/discussions/49683#discussioncomment-5612162
[Complete] Sub-RFC 2: Signal APIs #49683https://github.com/angular/angular/discussions/49683
[Complete] Sub-RFC 2: Signal APIs #49683 (comment)https://github.com/angular/angular/discussions/49683#discussioncomment-5598532
@alxhubhttps://github.com/alxhub
[Complete] Sub-RFC 2: Signal APIs #49683 (reply in thread)https://github.com/angular/angular/discussions/49683#discussioncomment-5612162
https://stackoverflow.com/questions/77689615/is-there-a-way-to-use-the-previous-value-of-a-computed-angular-signalhttps://stackoverflow.com/questions/77689615/is-there-a-way-to-use-the-previous-value-of-a-computed-angular-signal
https://github.com/nartc/ngxtension-platform/blob/main/libs/ngxtension/computed/src/computed.tshttps://github.com/nartc/ngxtension-platform/blob/main/libs/ngxtension/computed/src/computed.ts
angular/packages/core/primitives/signals/src/computed.tshttps://github.com/angular/angular/blob/ca239e8b62017b8460d73e58085d0f1c53a642ff/packages/core/primitives/signals/src/computed.ts#L110-L117
ca239e8https://github.com/angular/angular/commit/ca239e8b62017b8460d73e58085d0f1c53a642ff
that threadhttps://github.com/angular/angular/discussions/49683#discussioncomment-5598532
https://github.com/JoostK
JoostKhttps://github.com/JoostK
on Feb 8, 2024https://github.com/angular/angular/issues/54339#issuecomment-1934270671
JoostKhttps://github.com/JoostK
cross-cutting: signalshttps://github.com/angular/angular/issues?q=state%3Aopen%20label%3A%22cross-cutting%3A%20signals%22
on Feb 8, 2024https://github.com/angular/angular/issues/54339#event-11746788907
pkozlowski-opensourcehttps://github.com/pkozlowski-opensource
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
on Feb 8, 2024https://github.com/angular/angular/issues/54339#event-11748877424
ngbothttps://github.com/apps/ngbot
needsTriagehttps://github.com/angular/angular/milestone/83
on Feb 8, 2024https://github.com/angular/angular/issues/54339#event-11748877845
https://github.com/alxhub
alxhubhttps://github.com/alxhub
on Feb 8, 2024https://github.com/angular/angular/issues/54339#issuecomment-1934614024
https://github.com/pfeileon
pfeileonhttps://github.com/pfeileon
on Feb 13, 2024https://github.com/angular/angular/issues/54339#issuecomment-1940716030
https://github.com/alxhub
alxhubhttps://github.com/alxhub
on Apr 9, 2024https://github.com/angular/angular/issues/54339#issuecomment-2045532773
alxhubhttps://github.com/alxhub
not plannedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Anot-planned
on Apr 9, 2024https://github.com/angular/angular/issues/54339#event-12409219720
https://github.com/anhallbe
anhallbehttps://github.com/anhallbe
on Apr 19, 2024https://github.com/angular/angular/issues/54339#issuecomment-2065989073
https://github.com/pfeileon
pfeileonhttps://github.com/pfeileon
on Apr 19, 2024https://github.com/angular/angular/issues/54339#issuecomment-2066208953
https://github.com/Harpush
Harpushhttps://github.com/Harpush
on Apr 19, 2024https://github.com/angular/angular/issues/54339#issuecomment-2066624408
@anhallbehttps://github.com/anhallbe
https://github.com/anhallbe
anhallbehttps://github.com/anhallbe
on Apr 23, 2024https://github.com/angular/angular/issues/54339#issuecomment-2071679580
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on May 24, 2024https://github.com/angular/angular/issues/54339#issuecomment-2128258634
automatic conversation locking policyhttps://github.com/angular/angular/blob/8f24bc9443b3872fe095d9f7f77b308a361a13b4/docs/GITHUB_PROCESS.md#conversation-locking
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on May 24, 2024https://github.com/angular/angular/issues/54339#event-12916526019
JoostKhttps://github.com/JoostK
Computed signal with current value as input #64022https://github.com/angular/angular/issues/64022
on Sep 24, 2025https://github.com/angular/angular/issues/54339#event-19889317366
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/54339
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/54339
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.