const intialState = {
  isInternetReachable: undefined,
};

const clearState = {
  isInternetReachable: undefined,
};

export default (state = intialState, action) => {
  switch (action.type) {
    case "NETWORK_CONNECTED":
      return {
        isInternetReachable: true,
      };
    case "NETWORK_DISCONNECTED":
      return { isInternetReachable: false };
    case "NETWORK_DEFAULT":
      return clearState;
    default:
      return state;
  }
};
