Skip to content

Instantly share code, notes, and snippets.

@emanueleDiVizio
Created June 8, 2020 14:55
Show Gist options
  • Select an option

  • Save emanueleDiVizio/ca020d7ec921651b0efdf4ca970c4a8a to your computer and use it in GitHub Desktop.

Select an option

Save emanueleDiVizio/ca020d7ec921651b0efdf4ca970c4a8a to your computer and use it in GitHub Desktop.

Revisions

  1. emanueleDiVizio created this gist Jun 8, 2020.
    7 changes: 7 additions & 0 deletions useNetworkInfo.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    const isConnectedSelector = state => state.network.isConnected;

    const useNetworkInfo = () => {
    const isConnected = useSelector(isConnectedSelector);

    return [isConnected];
    }