import { NETWORK_STATUS as e } from "./network.constants"
export const calcNetworkStatus = (o) =>
o.loaded ? (o.online ? (0 === o.port || o.degraded ? e.TRICKY : e.ONLINE) : e.OFFLINE) : e.UNKNOWN
export const isNetworkStatusChanged = (e, o) =>
e.host !== o.host ||
e.port !== o.port ||
e.online !== o.online ||
e.degraded !== o.degraded ||
e.connections !== o.connections ||
e.peers.length !== o.peers.length ||
e.peers.some((e, t) => e !== o.peers[t])