electron-toolkit
electron-toolkit copied to clipboard
feat(typed-ipc): main process `IpcListener` cleanup functions
Description
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 https://github.com/alex8088/electron-toolkit/issues/19
Additional context
I added vitest and tests for the main process's IpcListener.
I'll add some notes to the code.
What is the purpose of this pull request?
- [ ] Bug fix
- [x] New Feature
- [ ] Documentation update
- [ ] Other
Before submitting the PR, please make sure you do the following
- [x] Read the Contributing Guidelines.
- [x] Read the Pull Request Guidelines and follow the Commit Convention.
- [x] Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g.
fixes #123).