Integrating Electron IPC Handlers with Effect
I'm a bit lost on solving a particular problem around some event listeners.
Imagine I have a program like this:
In some legacy code that I want to move to Effect, I have these Electron IPC handlers.
Note that
What I can't figure out is how to set these listeners up inside of my program, run effects, and still return a real value from the callback. Also note that these callbacks are called many times, often several times per second or more. They're not torn down until the application quits.
Imagine I have a program like this:
In some legacy code that I want to move to Effect, I have these Electron IPC handlers.
Note that
ipcMain is a global provided by the Electron runtime, and also note that the return value of the handle callback is important, because it's returned back to the process making the IPC.What I can't figure out is how to set these listeners up inside of my program, run effects, and still return a real value from the callback. Also note that these callbacks are called many times, often several times per second or more. They're not torn down until the application quits.
