Skip to content

Conversation

n1ru4l
Copy link

@n1ru4l n1ru4l commented Oct 26, 2018

No description provided.

@n1ru4l n1ru4l changed the title add flow typ declarations add flow type declarations Oct 26, 2018
index.js.flow Outdated
onOnline?: () => void,
onOffline?: () => void,
onStatusChange?: (online: boolean) => void,
}): boolean;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar to Flowtype, but could these typings be extracted to a separate type, like my suggestion on the TypeScript PR?

Something like:

interface OnlineStatusOpts {
    onOnline?: () => void,
    onOffline?: () => void,
    onStatusChange?: (online: boolean) => void,
}

export default function useOnlineStatus(opts: OnlineStatusOpts): boolean;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants