Open myty opened 3 years ago
This would return the NetworkInformation interface from this: https://github.com/AndcultureCode/AndcultureCode.JavaScript.Core/issues/101
Proposed hook could look something like this:
const useNetworkInformation = (): NetworkState => { const [networkState, setNetworkState] = useState<NetworkState>({ isOnline: true, }); useEffect(() => { /* add and remove connection change handler */ }, []); return { ...networkState } };
This would return the NetworkInformation interface from this: https://github.com/AndcultureCode/AndcultureCode.JavaScript.Core/issues/101
Proposed hook could look something like this: