Skip to content

Add useNetworkInformation hook #65

Description

@myty

This would return the NetworkInformation interface from this: rsm-hcd/AndcultureCode.JavaScript.Core#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
    }
};

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions