Created
July 4, 2017 01:41
-
-
Save krainboltgreene/f5202fdfd60ca2a411ebf2d2a4f799ef to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const {ipcRenderer} = window.require("electron") | |
| import xstream from "xstream" | |
| import logger from "@seditor/logger" | |
| export default function ipc (channel) { | |
| return xstream.create({ | |
| next (listener) { | |
| ipcRenderer.on(channel, (event, signal) => { | |
| listener.next(signal) | |
| }) | |
| }, | |
| start () {}, | |
| stop () { | |
| ipcRenderer.removeAllListeners([channel]) | |
| }, | |
| }) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment