2016-09-21 06:27:11 -08:00
|
|
|
import {ipcRenderer, remote} from 'electron';
|
|
|
|
|
|
2016-07-16 10:54:48 -08:00
|
|
|
const plugins = remote.require('./plugins');
|
2016-07-13 12:44:24 -08:00
|
|
|
|
2016-09-21 06:27:11 -08:00
|
|
|
export function getConfig() {
|
2016-07-16 10:54:48 -08:00
|
|
|
return plugins.getDecoratedConfig();
|
2016-07-13 12:44:24 -08:00
|
|
|
}
|
|
|
|
|
|
2016-09-21 06:27:11 -08:00
|
|
|
export function subscribe(fn) {
|
2016-07-13 12:44:24 -08:00
|
|
|
ipcRenderer.on('config change', fn);
|
2016-07-16 10:57:42 -08:00
|
|
|
ipcRenderer.on('plugins change', fn);
|
2016-07-13 12:44:24 -08:00
|
|
|
return () => {
|
|
|
|
|
ipcRenderer.removeListener('config change', fn);
|
|
|
|
|
};
|
|
|
|
|
}
|