aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/ducks/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/src/js/ducks/app.js')
-rw-r--r--web/src/js/ducks/app.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/web/src/js/ducks/app.js b/web/src/js/ducks/app.js
new file mode 100644
index 00000000..f1dcb490
--- /dev/null
+++ b/web/src/js/ducks/app.js
@@ -0,0 +1,27 @@
+import { connect as wsConnect, disconnect as wsDisconnect } from './websocket'
+
+export const INIT = 'APP_INIT'
+
+const defaultState = {}
+
+export function reduce(state = defaultState, action) {
+ switch (action.type) {
+
+ default:
+ return state
+ }
+}
+
+export function init() {
+ return dispatch => {
+ dispatch(wsConnect())
+ dispatch({ type: INIT })
+ }
+}
+
+export function destruct() {
+ return dispatch => {
+ dispatch(wsDisconnect())
+ dispatch({ type: DESTRUCT })
+ }
+}