-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
improve docs to point to memory leak if ngOnDestroy is overridden in … #4001
Conversation
…own component store
✅ Deploy Preview for ngrx-io ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@@ -14,6 +14,18 @@ Currently, Angular provides initializer tokens in a few areas. The `APP_INITIALI | |||
|
|||
</div> | |||
|
|||
<div class="alert is-important"> | |||
|
|||
**Note:** If you override the `ngOnDestroy` method in your component store, you need to call `super.ngOnDestroy()`. Otherwise a memory leak may occur. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would go better down at the bottom with the OnDestroy
section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
absolutely. i changed that.
@@ -138,6 +138,18 @@ ComponentStore also implements the `OnDestroy` interface from `@angulare/core` t | |||
|
|||
It also exposes a `destroy$` property on the ComponentStore class that can be used instead of manually creating a `Subject` to unsubscribe from any observables created in the component. | |||
|
|||
<div class="alert is-important"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not put the code snippet inside the div.alert
. Put it after the closing div
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To extend upon this comment, I think it would be better to the full snippet.
Also, instead of using the markdown code-block syntax, it's better to put wrap the code within a <code-example header="books-page.component.ts">
tag.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok i added the code snipped
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ValentinBossi !
…own component store
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Closes #3982
What is the new behavior?
Does this PR introduce a breaking change?
Other information