New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@byojs/scheduler

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@byojs/scheduler - npm Package Compare versions

Comparing version 0.0.9 to 0.9.0

12

package.json
{
"name": "@byojs/scheduler",
"description": "Throttle/debounce scheduler",
"version": "0.0.9",
"version": "0.9.0",
"exports": {

@@ -30,6 +30,12 @@ "./": "./dist/scheduler.mjs"

},
"keywords": [],
"keywords": [
"debounce",
"throttle",
"scheduling",
"task",
"async"
],
"bugs": {
"url": "https://github.com/byojs/scheduler/issues",
"email": "--TODO--"
"email": "getify@gmail.com"
},

@@ -36,0 +42,0 @@ "homepage": "https://github.com/byojs/scheduler",

@@ -6,4 +6,4 @@ export default Scheduler;

function Scheduler(debounceMin,throttleMax = Infinity,leading = false) {
throttleMax = Math.max(debounceMin,throttleMax);
function Scheduler(initialDelay,maxDelay = Infinity,leading = false) {
maxDelay = Math.max(initialDelay,maxDelay);
var entries = new WeakMap();

@@ -43,7 +43,7 @@

// NO room left to debounce while still under the throttle-max?
!((now - entry.last) <= throttleMax)
!((now - entry.last) <= maxDelay)
) {
clearTimer(entry);
fn();
entry.timer = setTimeout(clearTimer,debounceMin,entry);
entry.timer = setTimeout(clearTimer,initialDelay,entry);
}

@@ -60,3 +60,3 @@ else {

// room left to debounce while still under the throttle-max?
(now - entry.last) < throttleMax
(now - entry.last) < maxDelay
) {

@@ -77,3 +77,3 @@ setTimer(fn,entry,now);

clearTimer(entry);
var time = Math.min(debounceMin,Math.max(0,(entry.last + throttleMax) - now));
var time = Math.min(initialDelay,Math.max(0,(entry.last + maxDelay) - now));
entry.timer = setTimeout(run,time,fn,entry);

@@ -80,0 +80,0 @@ }

Sorry, the diff of this file is not supported yet

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