Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flow type declarations #4

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

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