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

added clear() #8

Closed
wants to merge 1 commit into from
Closed

added clear() #8

wants to merge 1 commit into from

Conversation

tjmehta
Copy link
Contributor

@tjmehta tjmehta commented Jun 7, 2016

fixes #7 , let me know if you have another api in mind

Thanks!

@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling bb0183d on tjmehta:clear into 40613a8 on thenables:master.

@@ -17,6 +17,13 @@ var timeout = require('timeout-then');
timeout(100).then(function () {
console.log('blah');
});

// clear timeout
var promise = timeout(100);
Copy link
Member

Choose a reason for hiding this comment

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

Is var timer = timeout(100) more semantic?

@tjmehta
Copy link
Contributor Author

tjmehta commented Jun 7, 2016

updated changes

@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 0f4e952 on tjmehta:clear into 40613a8 on thenables:master.

@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling c83abfd on tjmehta:clear into 40613a8 on thenables:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling c83abfd on tjmehta:clear into 40613a8 on thenables:master.

@coveralls
Copy link

coveralls commented Jun 7, 2016

Coverage Status

Coverage remained the same at 100.0% when pulling 0f4e952 on tjmehta:clear into 40613a8 on thenables:master.

@@ -2,7 +2,12 @@
var Promise = require('native-or-bluebird')

module.exports = function (interval) {
return new Promise(function (resolve) {
setTimeout(resolve, interval || 0)
var timeoutId
Copy link
Member

Choose a reason for hiding this comment

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

prefer timer, in node, setTimeout return a obj!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Okay, I was just following MDN
https://developer.mozilla.org/en-US/docs/Web/API/WindowTimers/setTimeout

Will change

Typed using my thumbs..

On Jun 9, 2016, at 6:55 AM, haoxin notifications@github.com wrote:

In index.js:

@@ -2,7 +2,12 @@
var Promise = require('native-or-bluebird')

module.exports = function (interval) {

  • return new Promise(function (resolve) {
  • setTimeout(resolve, interval || 0)
  • var timeoutId
    prefer timer, in node, setTimeout return a obj!


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@haoxins
Copy link
Member

haoxins commented Jun 11, 2016

383015a

@haoxins haoxins closed this Jun 11, 2016
@haoxins haoxins mentioned this pull request Jun 11, 2016
@haoxins
Copy link
Member

haoxins commented Jun 11, 2016

@jonathanong need npm right to publish a new version!

@haoxins haoxins mentioned this pull request Aug 3, 2016
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.

clear timeout
3 participants