"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.initialState = {
    state: 0 /* Idle */,
};
function reducer(state, action) {
    switch (action.type) {
        case "CONNECT_CONNECT" /* Connect */:
            return Object.assign({}, state, { state: 1 /* Active */, join: action.data });
        case "CONNECT_DISCONNECT" /* Disconnect */:
            return Object.assign({}, state, { state: 0 /* Idle */, join: undefined });
        case "CONNECT_UPDATE_STATE" /* UpdateState */:
            return Object.assign({}, state, { controlsState: action.controlsState });
        case "CONNECT_SET_CHANNEL" /* SetChannel */:
            return Object.assign({}, state, { channelOverride: action.channelID });
        default:
            return state;
    }
}
exports.reducer = reducer;
