Skip to content

Emitter: only store last event if replay is active #944

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

Merged
merged 1 commit into from
Jun 5, 2025

Conversation

mcdenhoed
Copy link
Contributor

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 dockview onDidRemovePanel 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!

Copy link

codesandbox-ci bot commented Jun 5, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 2f2da2b:

Sandbox Source
customheader-dockview Configuration
dockview-app Configuration
editor-gridview Configuration
externaldnd-dockview Configuration
fullwidthtab-dockview Configuration
iframe-dockview Configuration
keyboard-dockview Configuration
nativeapp-dockview Configuration
rendering-dockview Configuration

@mathuo mathuo changed the base branch from master to 946-gc-efficiencies June 5, 2025 16:48
@mathuo mathuo merged commit 1d85bfa into mathuo:946-gc-efficiencies Jun 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants