You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 27, 2023. It is now read-only.
I apologize if the solution to my issue is simple, as I'm still learning Fable (and F# actually).
I'm trying to use the Electron ipcRenderer and ipcMain for inter/process communication (like I normally would in regular electron development). In my renderer I have something like this:
electron.ipcRenderer.send("Hello", ["World"])
Then in my Main.fs, I set up a listener:
electron.ipcMain.on("Hello", unbox(fun x -> printfn "Hello %A" x)) |> ignore
And when I execute, I get the text Hello [object Object] (which I recognize very well from Javascript development.)
The type signature of of the 'send' function is (channel: string *, args: obj []) -> unit
So if i'm reading that correctly, the send function requires a string to representing the channel name, and arguments which is a list of Objects?
So my question is, how can I enforce a type when sending arguments through ipcRenderer send and receive that same type in my callback function in ipcMain?
Also, is there any documentation for these import APIs? I was not able to find any.