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

@ngrx/signals: Potential memory leak in rxMethod #4528

Closed
1 of 2 tasks
rainerhahnekamp opened this issue Sep 22, 2024 · 0 comments · Fixed by #4529
Closed
1 of 2 tasks

@ngrx/signals: Potential memory leak in rxMethod #4528

rainerhahnekamp opened this issue Sep 22, 2024 · 0 comments · Fixed by #4529

Comments

@rainerhahnekamp
Copy link
Contributor

Which @ngrx/* package(s) are the source of the bug?

signals

Minimal reproduction of the bug/regression with instructions

Any component that passes on a Signal to an rxMethod of a service provided in root, will cause a memory leak, because the rxMethod's effect is using the RootInjector:

https://stackblitz.com/edit/github-kvz3tp?file=src%2Fmain.ts

Expected behavior

If a component passes a Signal to an rxMethod instance that has been created in the root injector, the internal effect should run with the component's injector.

Versions of NgRx, Angular, Node, affected browser(s) and operating system(s)

Latest versions

Other information

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants