-
Notifications
You must be signed in to change notification settings - Fork 13
/
index.js
27 lines (24 loc) · 628 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const dispose = require('./modules/dispose');
const {
applyConfig,
generateActivateCallback,
onApp,
} = require('./modules/app');
const {
generateBlurCallback,
hideWindows,
showWindows,
} = require('./modules/windows');
let cfgUnsubscribe, handleActivate, handleBlur;
exports.onApp = app => {
handleBlur = generateBlurCallback(hideWindows, app);
handleActivate = generateActivateCallback(showWindows, app);
cfgUnsubscribe = onApp(
app,
applyConfig.bind(this, app, handleBlur),
handleActivate
);
};
exports.onUnload = app => {
dispose(app, { cfgUnsubscribe, handleActivate, handleBlur });
};