Skip to content

Commit ea0f64c

Browse files
committed
move actions/store out of subscriptions
1 parent 99d2651 commit ea0f64c

File tree

7 files changed

+34
-70
lines changed

7 files changed

+34
-70
lines changed

lib/editor/subscriptions.js

+3-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/editor/subscriptions.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/editor/subscriptions.ts

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,17 @@
1-
import {alertReplay, testRun, windowToggle} from '../actions';
2-
import store from '../store';
31
import {CompositeDisposable} from 'atom';
42

53
export default class Subscriptions {
64
private subscriptions = new CompositeDisposable();
75

8-
public onActivate(store: Redux.Store<any>): AtomCore.Disposable {
6+
public onActivate(store: Redux.Store<any>, actions): AtomCore.Disposable {
97
this.subscriptions.add(
108
atom.commands.add('atom-workspace', {
11-
'cr-viewer:toggle': () => store.dispatch(windowToggle())
9+
'cr-viewer:toggle': () => store.dispatch(actions.windowToggle())
1210
})
1311
);
1412
// run tests on save
1513
atom.workspace.observeTextEditors((editor: AtomCore.IEditor) => {
16-
this.subscriptions.add(editor.onDidSave(() => store.dispatch(testRun())));
14+
this.subscriptions.add(editor.onDidSave(() => store.dispatch(actions.testRun())));
1715
});
1816
// return all subscriptions
1917
return this.subscriptions;

src/index.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import * as React from 'react';
22
import * as ReactDOM from 'react-dom';
33

4-
import {addRightPanel} from './editor/ui';
5-
4+
import * as actions from './actions';
65
import {SideRoot, sideElement} from './components/SidePanel';
76
import addToStatusBar from './components/StatusBar';
87
import Subscriptions from './editor/subscriptions';
8+
import {addRightPanel} from './editor/ui';
99
import {setupVerify} from './modules/setup';
1010
import store from './store';
1111
import loadPolyfills from './utils/polyfills';
@@ -30,7 +30,7 @@ class Main {
3030
// create editor panel
3131
addRightPanel(this.side);
3232
// activate subscriptions
33-
this.subscriptions.onActivate(store);
33+
this.subscriptions.onActivate(store, actions);
3434
// render React component
3535
ReactDOM.render(SideRoot(store), this.side);
3636
}

tsconfig.json

+20-54
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
"moduleResolution": "node",
1313
"strictNullChecks": true,
1414
"outDir": "./lib",
15-
"rootDirs": ["src", "node_modules"]
15+
"rootDirs": [
16+
"src",
17+
"node_modules"
18+
]
1619
},
1720
"filesGlob": [
1821
"**/*.d.ts",
@@ -28,58 +31,6 @@
2831
"node_modules"
2932
],
3033
"files": [
31-
"node_modules/ajv/lib/ajv.d.ts",
32-
"node_modules/bowser/typings.d.ts",
33-
"node_modules/immutable/contrib/cursor/index.d.ts",
34-
"node_modules/immutable/dist/immutable-nonambient.d.ts",
35-
"node_modules/immutable/dist/immutable.d.ts",
36-
"node_modules/keycode/keycode.d.ts",
37-
"node_modules/redux/index.d.ts",
38-
"node_modules/redux/node_modules/symbol-observable/index.d.ts",
39-
"node_modules/reselect/lib/reselect.d.ts",
40-
"node_modules/reselect/src/reselect.d.ts",
41-
"node_modules/rx/ts/core/es6-iterable.d.ts",
42-
"node_modules/rx/ts/core/es6-promise.d.ts",
43-
"node_modules/rx/ts/es6-promise.es6.d.ts",
44-
"node_modules/rx/ts/iterable.es6.d.ts",
45-
"node_modules/rx/ts/rx.aggregates.d.ts",
46-
"node_modules/rx/ts/rx.aggregates.es6.d.ts",
47-
"node_modules/rx/ts/rx.all.d.ts",
48-
"node_modules/rx/ts/rx.all.es6.d.ts",
49-
"node_modules/rx/ts/rx.async.d.ts",
50-
"node_modules/rx/ts/rx.async.es6.d.ts",
51-
"node_modules/rx/ts/rx.backpressure.d.ts",
52-
"node_modules/rx/ts/rx.backpressure.es6.d.ts",
53-
"node_modules/rx/ts/rx.binding.d.ts",
54-
"node_modules/rx/ts/rx.binding.es6.d.ts",
55-
"node_modules/rx/ts/rx.coincidence.d.ts",
56-
"node_modules/rx/ts/rx.coincidence.es6.d.ts",
57-
"node_modules/rx/ts/rx.core.binding.d.ts",
58-
"node_modules/rx/ts/rx.core.binding.es6.d.ts",
59-
"node_modules/rx/ts/rx.core.d.ts",
60-
"node_modules/rx/ts/rx.core.es6.d.ts",
61-
"node_modules/rx/ts/rx.core.testing.d.ts",
62-
"node_modules/rx/ts/rx.core.testing.es6.d.ts",
63-
"node_modules/rx/ts/rx.d.ts",
64-
"node_modules/rx/ts/rx.es6.d.ts",
65-
"node_modules/rx/ts/rx.experimental.d.ts",
66-
"node_modules/rx/ts/rx.experimental.es6.d.ts",
67-
"node_modules/rx/ts/rx.joinpatterns.d.ts",
68-
"node_modules/rx/ts/rx.joinpatterns.es6.d.ts",
69-
"node_modules/rx/ts/rx.lite.d.ts",
70-
"node_modules/rx/ts/rx.lite.es6.d.ts",
71-
"node_modules/rx/ts/rx.lite.extras.d.ts",
72-
"node_modules/rx/ts/rx.lite.extras.es6.d.ts",
73-
"node_modules/rx/ts/rx.sorting.d.ts",
74-
"node_modules/rx/ts/rx.sorting.es6.d.ts",
75-
"node_modules/rx/ts/rx.testing.d.ts",
76-
"node_modules/rx/ts/rx.testing.es6.d.ts",
77-
"node_modules/rx/ts/rx.time.d.ts",
78-
"node_modules/rx/ts/rx.time.es6.d.ts",
79-
"node_modules/rx/ts/rx.virtualtime.d.ts",
80-
"node_modules/rx/ts/rx.virtualtime.es6.d.ts",
81-
"node_modules/symbol-observable/index.d.ts",
82-
"node_modules/testcheck/dist/testcheck.d.ts",
8334
"src/typings/cli/index.d.ts",
8435
"src/typings/coderoad/index.d.ts",
8536
"src/typings/common/action.d.ts",
@@ -117,6 +68,7 @@
11768
"src/typings/globals/redux-thunk/index.d.ts",
11869
"src/typings/globals/redux/index.d.ts",
11970
"src/typings/globals/reselect/index.d.ts",
71+
"src/typings/globals/rx/index.d.ts",
12072
"src/typings/globals/sort-package-json/index.d.ts",
12173
"src/typings/globals/space-pen/index.d.ts",
12274
"src/typings/globals/status-bar/index.d.ts",
@@ -133,11 +85,24 @@
13385
"src/components/SidePanel/sideElement.ts",
13486
"src/components/StatusBar/index.ts",
13587
"src/components/styles/theme.ts",
88+
"src/editor/actions/console.ts",
89+
"src/editor/actions/editor.ts",
90+
"src/editor/actions/file.ts",
91+
"src/editor/actions/quit.ts",
92+
"src/editor/actions/tabs.ts",
93+
"src/editor/actions/terminal.ts",
94+
"src/editor/actions/write.ts",
95+
"src/editor/actions/writeFile.ts",
96+
"src/editor/directory.ts",
97+
"src/editor/grammar.ts",
98+
"src/editor/subscriptions.ts",
99+
"src/editor/ui.ts",
136100
"src/index.ts",
137101
"src/modules/alert/actions.ts",
138102
"src/modules/alert/index.ts",
139103
"src/modules/alert/types.ts",
140104
"src/modules/dir/index.ts",
105+
"src/modules/editor/actions.ts",
141106
"src/modules/editor/index.ts",
142107
"src/modules/editor/reducer.ts",
143108
"src/modules/editor/types.ts",
@@ -256,6 +221,7 @@
256221
"src/components/Tutorials/index.tsx",
257222
"src/components/Tutorials/LoadTutorials/index.tsx",
258223
"src/components/Tutorials/SelectTutorial/index.tsx",
259-
"src/components/Tutorials/UpdateTutorial/index.tsx"
224+
"src/components/Tutorials/UpdateTutorial/index.tsx",
225+
"src/editor/setup.tsx"
260226
]
261227
}

0 commit comments

Comments
 (0)