You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
501 B
JavaScript
24 lines
501 B
JavaScript
import ActionTypes from '../constants/ActionTypes';
|
|
|
|
const initialState = {
|
|
isDisconnected: false,
|
|
};
|
|
|
|
// eslint-disable-next-line default-param-last
|
|
export default (state = initialState, { type }) => {
|
|
switch (type) {
|
|
case ActionTypes.SOCKET_DISCONNECT_HANDLE:
|
|
return {
|
|
...state,
|
|
isDisconnected: true,
|
|
};
|
|
case ActionTypes.SOCKET_RECONNECT_HANDLE:
|
|
return {
|
|
...state,
|
|
isDisconnected: false,
|
|
};
|
|
default:
|
|
return state;
|
|
}
|
|
};
|