Big News: Socket raises $60M Series C at a $1B valuation to secure software supply chains for AI-driven development.Announcement
Sign In

simple-polling

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

simple-polling - npm Package Compare versions

Comparing version
0.1.0
to
0.2.0
+1
-2
example.js

@@ -7,3 +7,2 @@ var poll = require('./poll')

.timeout(15000)
.then(function (num) { console.log('Finished with: ' + num) })
.run()
.run(function (num) { console.log('Finished with: ' + num) })

@@ -7,3 +7,3 @@ {

},
"version": "0.1.0",
"version": "0.2.0",
"description": "A simple polling abstraction for repeating an asynchronous action until a desired outcome is achieved.",

@@ -10,0 +10,0 @@ "main": "poll.js",

@@ -6,3 +6,2 @@ module.exports = function (op) {

, interval_ms = 5000
, finish = function () {}

@@ -24,8 +23,3 @@ face.until = function (predicate) {

face.then = function (done) {
finish = done
return this
}
face.run = function run() {
face.run = function run(cb) {
var started = Date.now()

@@ -37,3 +31,3 @@

pred.apply(null, arguments) || (timeout_ms && elapsed >= timeout_ms)
? finish.apply(null, arguments)
? cb.apply(null, arguments)
: setTimeout(function () { op(decision) }, interval_ms)

@@ -40,0 +34,0 @@ })