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

Implement connectionStatus.startChecking(options) & connectionStatus.stopChecking() #13

Closed
courajs opened this issue Nov 17, 2015 · 4 comments

Comments

@courajs
Copy link
Contributor

courajs commented Nov 17, 2015

.check() can trigger a recurring check, but returns a single promise. The promise will resolve once, or reject once, even if the connection status changes later.
I think you'd be doing these for different reasons. The recurring check would likely be for some user notification. A one-time check is more likely in response to something, like an error.
I think maybe these two things should be separate. Like a .check() that returns a promise, and a .startChecking({interval, timeout}) to start getting the events.

@gr2m
Copy link
Member

gr2m commented Nov 17, 2015

good thinking, I think having two methods for one-time checks vs intervals makes it more clear. And with .startChecking({interval, timeout}) we can also add .stopChecking(). I'd say let's do that :)

@gr2m
Copy link
Member

gr2m commented Nov 21, 2015

connectionStatus.startChecking({
  interval: 30000, // ms
  timeout: 3000 // request timeout before aborting request
}) // returns undefined
connectionStatus.stopChecking() // returns undefined

@jennazee
Copy link
Member

I'll give this a shot!

@gr2m gr2m changed the title Split .check()? Implement connectionStatus.startChecking(options) & connectionStatus.stopChecking() Dec 12, 2015
@gr2m
Copy link
Member

gr2m commented Dec 13, 2015

done via 33d9e98

@gr2m gr2m closed this as completed Dec 13, 2015
@gr2m gr2m removed the in progress label Dec 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants