Skip to content

Add useNetworkInformation hook #65

@myty

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
    }
};

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