|
1 | 1 | "use strict"; |
2 | | -var CompositeDisposable = require('atom').CompositeDisposable; |
3 | | -var store_1 = require('./store'); |
| 2 | +var atom_1 = require('atom'); |
4 | 3 | var actions_1 = require('./actions'); |
5 | 4 | var SidePanel_1 = require('./components/SidePanel'); |
6 | 5 | var TopPanel_1 = require('./components/TopPanel'); |
7 | 6 | var subscriptions = null; |
8 | | -function onActivate() { |
9 | | - subscriptions = new CompositeDisposable; |
| 7 | +function onActivate(store) { |
| 8 | + subscriptions = new atom_1.CompositeDisposable; |
10 | 9 | subscriptions.add(atom.commands.add('atom-workspace', { |
11 | | - 'cb-viewer:toggle': function () { return store_1.default.dispatch(actions_1.windowToggle()); } |
| 10 | + 'cb-viewer:toggle': function () { return store.dispatch(actions_1.windowToggle()); } |
12 | 11 | })); |
13 | 12 | atom.workspace.observeTextEditors(function (editor) { |
14 | 13 | subscriptions.add(editor.onDidSave(function () { |
15 | | - if (store_1.default.getState().window) { |
16 | | - store_1.default.dispatch(actions_1.tutorialBuild()); |
17 | | - store_1.default.dispatch(actions_1.tutorialLoad()); |
| 14 | + if (store.getState().window) { |
| 15 | + store.dispatch(actions_1.tutorialBuild()); |
| 16 | + store.dispatch(actions_1.tutorialLoad()); |
18 | 17 | } |
19 | 18 | })); |
20 | 19 | }); |
21 | 20 | return subscriptions; |
22 | 21 | } |
23 | 22 | exports.onActivate = onActivate; |
24 | | -function onDeactivate() { |
| 23 | +function onDeactivate(store) { |
25 | 24 | SidePanel_1.sideElement.unmount(); |
26 | 25 | TopPanel_1.topElement.unmount(); |
27 | | - store_1.default.subscribe(function () { return null; }); |
| 26 | + store.subscribe(function () { return null; }); |
28 | 27 | subscriptions.dispose(); |
29 | 28 | } |
30 | 29 | exports.onDeactivate = onDeactivate; |
0 commit comments