/
githubmirror
/
hyper
Обзор
Документация
Войти
/
githubmirror
/
hyper
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
v3.1.0
lib/utils/config.ts
16 строк
579 B
Benjamin Staneck
add TODO comments for the new Electron async APIs that replace the remote module
25 окт 2019, 16:34
25 окт 2019, 16:34
03ff483
Код
Авторство
О чём код?
import {ipcRenderer, remote} from 'electron'; // TODO: Should be updates to new async API https://medium.com/@nornagon/electrons-remote-module-considered-harmful-70d69500f31 const plugins = remote.require('./plugins') as typeof import('../../app/plugins'); export function getConfig() { return plugins.getDecoratedConfig(); } export function subscribe(fn: (event: Electron.IpcRendererEvent, ...args: any[]) => void) { ipcRenderer.on('config change', fn); ipcRenderer.on('plugins change', fn); return () => { ipcRenderer.removeListener('config change', fn); }; }