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

@aspectron/flow-async

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aspectron/flow-async - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

33

lib/async.js

@@ -13,2 +13,35 @@ const fasync = { };

/**
* debounce provided function for given time
* @param {String} name key name to debounce function
* @param {Number} time time in milliseconds for delay
* @param {Function} fn a function to debounce
* @return {Object} a reference to debounced function
* @since 0.0.1
*/
fasync._debounce = new Map();
fasync.debounce = (name, time, fn)=>{
if(typeof time == 'function'){
let _fn = fn;
fn = time;
time = _fn;
}
if(fasync._debounce.has(name))
fasync._debounce.get(name).cancel();
fasync._debounce.set(name, {
id:setTimeout(fn, time),
cancel(){
if(this.id){
clearTimeout(this.id)
this.id = null;
}
}
})
return fasync._debounce.get(name);
}
fasync.Semaphore = class Semaphore extends Promise {

@@ -15,0 +48,0 @@ constructor(name) {

2

package.json
{
"name": "@aspectron/flow-async",
"version": "1.0.0",
"version": "1.1.0",
"description": "Async Utility Functions",

@@ -5,0 +5,0 @@ "main": "index.js",

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