aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/ducks/app.js
diff options
context:
space:
mode:
authorMaximilian Hils <git@maximilianhils.com>2016-06-23 23:38:19 -0700
committerMaximilian Hils <git@maximilianhils.com>2016-06-23 23:38:19 -0700
commit21c3480429108cbbd45f5ae3de7a36d15460cdc3 (patch)
tree43f7df8c382bee7b9e5feb831379541685cfb4c0 /web/src/js/ducks/app.js
parented05d3f858fb6b7c93b2353c947d88b3aefcd1ae (diff)
parent57af1d00ddd16bd36609a8c6dbf61411f5cd504c (diff)
downloadmitmproxy-21c3480429108cbbd45f5ae3de7a36d15460cdc3.tar.gz
mitmproxy-21c3480429108cbbd45f5ae3de7a36d15460cdc3.tar.bz2
mitmproxy-21c3480429108cbbd45f5ae3de7a36d15460cdc3.zip
Merge remote-tracking branch 'jason/websocket'
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 })
+ }
+}