https://github.com/jclem/electron-effect
https://github.com/jclem/electron-effect
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/jclem/electron-effect
- Owner: jclem
- License: mit
- Created: 2024-05-07T14:25:24.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-09-17T22:31:52.000Z (over 1 year ago)
- Last Synced: 2025-03-24T10:52:51.192Z (about 1 year ago)
- Language: TypeScript
- Size: 261 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Effect / Electron IPC Handlers
This repository demonstrates a problem that arises when one wants to use
services created with Effect inside of Electron IPC handlers, which are event
listeners whose callbacks must return a value, and that value is then sent back
to the renderer process by the Electron runtime.
## Running
Note that I have only tested this on macOS.
```sh
$ git clone https://github.com/jclem/electron-effect
$ cd electron-effect
$ npm install
$ npm start
```
## Tour
- `src/main.ts` is the main Electron process. It sets up our Effect program and IPC handlers.
- `src/renderer.ts` is the renderer process. It sends a message to the main process and logs the response.
- `src/preload.ts` defines our IPC API.