mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-22 20:55:50 +00:00
Update content/tutorials/build-apps/build-a-desktop-wallet-in-javascript.md
Co-authored-by: Jackson Mills <aim4math@gmail.com>
This commit is contained in:
@@ -306,7 +306,7 @@ app.whenReady().then(() => {
|
|||||||
|
|
||||||
Here we first call our helper function `getValidatedLedgerIndex()` and then broadcast an event named `update-ledger-index`. This attaches a payload containing the latest ledger information which can be handled by the frontend.
|
Here we first call our helper function `getValidatedLedgerIndex()` and then broadcast an event named `update-ledger-index`. This attaches a payload containing the latest ledger information which can be handled by the frontend.
|
||||||
|
|
||||||
This example shows how to do Inter Process Communication (IPC) in Electron. Technically, JavaScript has no true parallel processes or threading, because it follows a single-threaded event-driven paradigm. Nonetheless Electron provides us with two IPC modules called `ipcMain` and `ipcRenderer`. We can roughly equate those two to a backend process and a frontend process when we think in terms of client-server applications. It works as follows:
|
This example shows how to do Inter Process Communication (IPC) in Electron. Technically, JavaScript has no true parallel processes or threading because it follows a single-threaded event-driven paradigm. Nonetheless Electron provides us with two IPC modules called `ipcMain` and `ipcRenderer`. We can roughly equate `ipcMain` to a backend process and `ipcRenderer` to a frontend process when we think in terms of client-server applications. It works as follows:
|
||||||
|
|
||||||
1. We started by creating a function that enables the frontend to subscribe to backend events via the ContextBridge (in `view/preload.js`)
|
1. We started by creating a function that enables the frontend to subscribe to backend events via the ContextBridge (in `view/preload.js`)
|
||||||
2. Then we make the function available by putting it in a preloader script to ensure it is loaded and can be used by the frontend.
|
2. Then we make the function available by putting it in a preloader script to ensure it is loaded and can be used by the frontend.
|
||||||
|
|||||||
Reference in New Issue
Block a user