Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cancellable-next-tick

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

cancellable-next-tick - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

12

package.json
{
"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
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc