aboutsummaryrefslogtreecommitdiffstats
path: root/web/src/js/ducks/app.js
blob: f1dcb490c8d4504303dabf6e49fc10e6c6c5b368 (plain)
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
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 })
    }
}