René's URL Explorer Experiment


Title: Calling effect cleanup multiple times not working · Issue #58211 · angular/angular · GitHub

Open Graph Title: Calling effect cleanup multiple times not working · Issue #58211 · angular/angular

X Title: Calling effect cleanup multiple times not working · Issue #58211 · angular/angular

Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description Calling the effect cleanup multiple times inside the effect function only considers the last cleanup one. I don't know whether it is a bug ...

Open Graph Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description Calling the effect cleanup multiple times inside the effect function only considers the last cleanu...

X Description: Which @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description Calling the effect cleanup multiple times inside the effect function only considers the last cleanu...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Calling effect cleanup multiple times not working","articleBody":"### Which @angular/* package(s) are the source of the bug?\n\ncore\n\n### Is this a regression?\n\nYes\n\n### Description\n\nCalling the effect cleanup multiple times inside the effect function only considers the last cleanup one. I don't know whether it is a bug or missing feature. Till today i thought it is supported similar to `DestroyRef`.\n\n```ts\n\nclass TestComponent {\n    constructor() {\n        effect((onCleanup) => {\n            const target = this.target();\n            ....\n            const resizeObserver = new ResizeObserver(() => {\n                ....\n            });\n            resizeObserver.observe(target());\n            onCleanup(() => resizeObserver.disconnect());\n\n            if (checkScroll) {\n                target.addEventListener('scroll', this.updateDimension);\n                onCleanup(() => target.removeEventListener('scroll', this.updateDimension)); // Only this cleanup gets called\n            }\n        });\n    }\n}\n```\n\n\n### Please provide a link to a minimal reproduction of the bug\n\n_No response_\n\n### Please provide the exception or error you saw\n\n_No response_\n\n### Please provide the environment you discovered this bug in (run `ng version`)\n\nAngular CLI: 18.1.1\nNode: 20.17.0\nPackage Manager: pnpm 9.8.0\nOS: win32 x64\n\nAngular: 18.1.1\n... animations, cdk, cli, common, compiler, compiler-cli, core\n... forms, platform-browser, platform-browser-dynamic\n... platform-server, router, ssr\n\nPackage                         Version\n---------------------------------------------------------\n@angular-devkit/architect       0.1801.1\n@angular-devkit/build-angular   18.1.1\n@angular-devkit/core            18.1.1\n@angular-devkit/schematics      18.1.1\n@angular/build                  18.0.0\n@schematics/angular             18.1.1\nng-packagr                      18.1.0\nrxjs                            7.8.1\ntypescript                      5.4.5\n\n### Anything else?\n\n_No response_","author":{"url":"https://github.com/sheikalthaf","@type":"Person","name":"sheikalthaf"},"datePublished":"2024-10-15T17:03:44Z","url":"https://github.com/angular/angular/issues/58211"}

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:6bcfd07b-58a0-7496-fc03-26b46cc37098
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idBCEC:AFBD9:1332745:195EF7B:6B01EF9A
html-safe-nonce125cca2a07059c07a7121a5025876aca13dc37b3adfcb446872ff66a6ba1acd1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQ0VDOkFGQkQ5OjEzMzI3NDU6MTk1RUY3Qjo2QjAxRUY5QSIsInZpc2l0b3JfaWQiOiI0MTU2MzA2NDI2MTI3NTc2OTg3IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacf5cfe3e3605f2bbc617a2d5b47358805e5a332f7c1bbcf2be5ed2797edf35616
hovercard-subject-tagissue:2589371257
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/58211/issue_layout
twitter:imagehttps://opengraph.githubassets.com/84ee8669eda8bebe72cfbd66f3685219f0ea918a8bd30150c57f6774fd051710/angular/angular/issues/58211
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/84ee8669eda8bebe72cfbd66f3685219f0ea918a8bd30150c57f6774fd051710/angular/angular/issues/58211
og:image:altWhich @angular/* package(s) are the source of the bug? core Is this a regression? Yes Description Calling the effect cleanup multiple times inside the effect function only considers the last cleanu...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamesheikalthaf
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/58211#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fangular%2Fangular%2Fissues%2F58211
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%2F58211
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/58211
Reloadhttps://github.com/angular/angular/issues/58211
Reloadhttps://github.com/angular/angular/issues/58211
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/58211
New issuehttps://github.com/login?return_to=https://github.com/angular/angular/issues/58211
Calling effect cleanup multiple times not workinghttps://github.com/angular/angular/issues/58211#top
https://github.com/sheikalthaf
sheikalthafhttps://github.com/sheikalthaf
on Oct 15, 2024https://github.com/angular/angular/issues/58211#issue-2589371257
https://github.com/garrettld
garrettldhttps://github.com/garrettld
on Oct 15, 2024https://github.com/angular/angular/issues/58211#issuecomment-2414648541
https://stackblitz.com/edit/stackblitz-starters-wyf4yc?file=src%2Fmain.tshttps://stackblitz.com/edit/stackblitz-starters-wyf4yc?file=src%2Fmain.ts
https://github.com/angular/angular/blob/main/packages/core/primitives/signals/src/watch.ts#L75-L77https://github.com/angular/angular/blob/main/packages/core/primitives/signals/src/watch.ts#L75-L77
https://github.com/sheikalthaf
sheikalthafhttps://github.com/sheikalthaf
on Oct 16, 2024https://github.com/angular/angular/issues/58211#issuecomment-2416908422
@garrettldhttps://github.com/garrettld
PR 56501https://github.com/angular/angular/pull/56501/files#diff-d350f6dfdd77593b52a63e68ecac002c1271baf04a60dfe9ac61d1a635ce29c2
https://github.com/alxhub
alxhubhttps://github.com/alxhub
on Oct 16, 2024https://github.com/angular/angular/issues/58211#issuecomment-2416956107
#56501https://github.com/angular/angular/pull/56501
alxhubhttps://github.com/alxhub
completedhttps://github.com/angular/angular/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Oct 16, 2024https://github.com/angular/angular/issues/58211#event-14681447893
https://github.com/apps/angular-automatic-lock-bot
angular-automatic-lock-bothttps://github.com/apps/angular-automatic-lock-bot
on Nov 16, 2024https://github.com/angular/angular/issues/58211#issuecomment-2480190665
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 16, 2024https://github.com/angular/angular/issues/58211#event-15319564019
Sign up for freehttps://github.com/signup?return_to=https://github.com/angular/angular/issues/58211
Sign in to commenthttps://github.com/login?return_to=https://github.com/angular/angular/issues/58211
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.