Emitter: only store last event if replay is active #944
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello! Thank you for this library! I've been porting an app over to it and it has been very nice to work with.
I ran into the following situation:
I'm using Angular and am needing to manually trigger Angular's
ngOnDestroy
lifecycle event on a component inside a dockview panel. To do this, I'm listening to the dockviewonDidRemovePanel
event. When the event fires, I trigger the angular lifecycle event and dispose of some references to the component.The issue is that, when I run chrome's profiler, it looks like dockview's event emitters always retain a reference to the "last" thing to come out of the emitter, even if not in "replay" mode.
In my case, this component is fairly heavy memory-wise and I'd really like to let it be GC'd. This change should make the emitter only retain the "last" event when necessary for the "replay" behavior.
Thanks again for publishing this!