Skip to content
Permalink
Branch: master
Find file Copy path
23 lines (20 sloc) 506 Bytes
import { CONNECTION_CHANGED } from '../actions';
const INITIAL_STATE = {
connected: false,
port: '3001'
};
function socketReducer(state = INITIAL_STATE, action: { type: string, port: string, connected: boolean }) {
let reduced;
switch (action.type) {
case CONNECTION_CHANGED:
reduced = Object.assign({}, state, {
connected: action.connected,
isError: false
});
break;
default:
reduced = state;
}
return reduced;
}
export default socketReducer;
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.