mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
How to avoid EventEmitter Max Listeners warning? #364
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @win32nipuh on GitHub (Jul 17, 2019).
Originally assigned to: @GregorBiswanger on GitHub.
I use Ipc to exchange data:
But after 11 page loadings I receive:
How and where I can increase this limit?
Is it problem or it is warning only?
@GregorBiswanger commented on GitHub (Jul 26, 2019):
The code is called again and again when you reload your page. You should therefore not repeat an event registration.
It is best to register your code globally rather than directly on the same page. Or use the unload event and cancel the registrations.
https://developer.mozilla.org/en-US/docs/Web/API/Window/unload_event
@ZedZipDev commented on GitHub (Jul 28, 2019):
Thanx, ok.
Now I do it in Controller/Action method.
But when I click menu the Controller object created again, its constructor etc.
Where is the best place to register it?
@GregorBiswanger commented on GitHub (May 10, 2020):
It's best to use a single-page app, or see the code from our demo app.
Alternatively, you can also use Blazor.
https://github.com/ElectronNET/electron.net-api-demos