cancellable-next-tick
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "cancellable-next-tick", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Wrapper around process.nextTick returning a cancel function", | ||
"main": "lib/index.js", | ||
"scripts": { | ||
"test": "tests/index.js" | ||
"test": "node tests/index.js" | ||
}, | ||
@@ -24,5 +24,9 @@ "repository": { | ||
"clearable", | ||
"clearing" | ||
"clearing", | ||
"micro" | ||
], | ||
"author": "Matthew Francis Brunetti <=>", | ||
"author": { | ||
"name": "Matthew Francis Brunetti", | ||
"email": "zenflow87@gmail.com" | ||
}, | ||
"license": "MIT", | ||
@@ -29,0 +33,0 @@ "bugs": { |
# cancellable-next-tick | ||
Wrapper around process.nextTick returning a cancel function | ||
## example usage (and use-case) | ||
## example usage | ||
```js | ||
var cancellableNextTick = require('cancellable-next-tick'); | ||
var cancel = cancellableNextTick(function(){ | ||
// ... | ||
}); | ||
cancel(); | ||
``` | ||
## example use-case | ||
```js | ||
function setValue(value){ | ||
var self = this; | ||
if (self.cancelEmit){ | ||
self.cancelEmit(); | ||
if (self._cancelEmit){ | ||
self._cancelEmit(); | ||
} | ||
self.cancelEmit = cancellableNextTick(function(){ | ||
self.emit('value', self.value); | ||
self._cancelEmit = cancellableNextTick(function(){ | ||
self.emit('value', value); | ||
delete self._cancelEmit; | ||
}); | ||
} | ||
``` | ||
``` | ||
## changelog | ||
### 1.0.1 | ||
* Enhanced readme | ||
* Enhanced package.json |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3264
31