-
Notifications
You must be signed in to change notification settings - Fork 9
Dawn Internal State Life Cycle
Due to Electron's roots in Chromium, it runs with the standard browser process model: a main process, to handle windows, and renderer processes, to actual handle display. For Dawn, the main process handles program start and networking; the single renderer handles everything else. A consequence of this two-process system is that which process running a particular file does matter, with complications if both deal with the same file (i.e. Constants.js
).
Dawn likes to keep state within each React component to minimize overhead; state involving multiple components/files is handled by Redux.
See Electron's webContents module, Redux-Saga
The reduxDispatch
function in RendererBridge.js
allows the main process to send Redux messages to the renderer process (Specifically to Redux-Saga's ansibleSaga
function).
See Electron's ipcMain, ipcRenderer, remote, and webContents modules
Generally, this means using ipcRenderer.send(<channel> [, info])
and ipcMain.on(<channel>, (event, arg) => ...)
, where channel (for here) is the name of what you want to send (e.g. 'studentCodeStatus').
© Pioneers In Engineering