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

typed-ipc: Return cleanup functions when subscribing via main thread IpcListener #19

Open
4 tasks done
psychedelicious opened this issue Dec 8, 2024 · 0 comments · May be fixed by #20
Open
4 tasks done

typed-ipc: Return cleanup functions when subscribing via main thread IpcListener #19

psychedelicious opened this issue Dec 8, 2024 · 0 comments · May be fixed by #20
Labels
enhancement New feature or request

Comments

@psychedelicious
Copy link

Clear and concise description of the problem

I want an easy way to unsubscribe individual listeners and handlers to have more granular control over IPC events.

As of 06b577a, cleanup functions are returned from the renderer process's IpcListener subscription methods. It would be nice for the main process's IpcListener to do the same.

Suggested solution

I'll submit a PR with a simple implementation.

Alternative

Manage subscriptions manually.

Additional context

No response

Validations

@psychedelicious psychedelicious added the enhancement New feature or request label Dec 8, 2024
psychedelicious added a commit to psychedelicious/electron-toolkit that referenced this issue Dec 8, 2024
The main process `IpcListener` now returns cleanup functions for its `on` and `handle` methods which remove the registered listener or handler.

Its `dispose` method now unsubscribes only listeners and handlers registered with this class instance.

Closes alex8088#19
@psychedelicious psychedelicious linked a pull request Dec 8, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant