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

@solid-primitives/scheduled

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solid-primitives/scheduled - npm Package Compare versions

Comparing version 1.4.3 to 1.4.4

2

dist/index.d.ts

@@ -131,2 +131,2 @@ import { Accessor } from 'solid-js';

export { ScheduleCallback, Scheduled, createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };
export { type ScheduleCallback, type Scheduled, createScheduled, debounce, leading, leadingAndTrailing, scheduleIdle, throttle };

@@ -11,7 +11,5 @@ import { getOwner, onCleanup, createSignal, getListener } from 'solid-js';

const clear = () => clearTimeout(timeoutId);
if (getOwner())
onCleanup(clear);
if (getOwner()) onCleanup(clear);
const debounced = (...args) => {
if (timeoutId !== void 0)
clear();
if (timeoutId !== void 0) clear();
timeoutId = setTimeout(() => callback(...args), wait);

@@ -28,4 +26,3 @@ };

lastArgs = args;
if (isThrottled)
return;
if (isThrottled) return;
isThrottled = true;

@@ -41,4 +38,3 @@ timeoutId = setTimeout(() => {

};
if (getOwner())
onCleanup(clear);
if (getOwner()) onCleanup(clear);
return Object.assign(throttled, { clear });

@@ -48,8 +44,7 @@ };

// requestIdleCallback is not supported in Safari
window.requestIdleCallback ? (callback, maxWait) => {
typeof requestIdleCallback !== "undefined" ? (callback, maxWait) => {
let isDeferred = false, id, lastArgs;
const deferred = (...args) => {
lastArgs = args;
if (isDeferred)
return;
if (isDeferred) return;
isDeferred = true;

@@ -68,4 +63,3 @@ id = requestIdleCallback(

};
if (getOwner())
onCleanup(clear);
if (getOwner()) onCleanup(clear);
return Object.assign(deferred, { clear });

@@ -81,4 +75,3 @@ } : (

const scheduled2 = (...args) => {
if (called)
return;
if (called) return;
called = true;

@@ -92,4 +85,3 @@ callback(...args);

const func = (...args) => {
if (!isScheduled)
callback(...args);
if (!isScheduled) callback(...args);
isScheduled = true;

@@ -102,4 +94,3 @@ scheduled();

};
if (getOwner())
onCleanup(clear);
if (getOwner()) onCleanup(clear);
return Object.assign(func, { clear });

@@ -111,4 +102,3 @@ }

const scheduled2 = (...args) => {
if (called)
return;
if (called) return;
called = true;

@@ -132,4 +122,3 @@ callback(...args);

if (state !== 2 /* Trailing */) {
if (state === 0 /* Ready */)
callback(...args);
if (state === 0 /* Ready */) callback(...args);
state += 1;

@@ -143,4 +132,3 @@ }

};
if (getOwner())
onCleanup(clear);
if (getOwner()) onCleanup(clear);
return Object.assign(fn, { clear });

@@ -157,4 +145,3 @@ }

return () => {
if (!isDirty)
call(), track();
if (!isDirty) call(), track();
if (isDirty) {

@@ -161,0 +148,0 @@ isDirty = !!listeners;

{
"name": "@solid-primitives/scheduled",
"version": "1.4.3",
"version": "1.4.4",
"description": "Primitives for creating scheduled — throttled or debounced — callbacks.",

@@ -62,3 +62,3 @@ "contributors": [

"@solid-primitives/event-listener": "^2.3.3",
"@solid-primitives/timer": "^1.3.9"
"@solid-primitives/timer": "^1.3.10"
},

@@ -65,0 +65,0 @@ "peerDependencies": {

@@ -16,3 +16,3 @@ <p>

- [`throttle`](#throttle) - Creates a callback that is **throttled** and cancellable.
- [`scheduleIdle`](#scheduleIdle) - Creates a callback throttled using `window.requestIdleCallback()`.
- [`scheduleIdle`](#scheduleidle) - Creates a callback throttled using `window.requestIdleCallback()`.
- [`leading`](#leading) - Creates a scheduled and cancellable callback that will be called on **leading** edge.

@@ -19,0 +19,0 @@ - [`createScheduled`](#createscheduled) - Creates a signal used for scheduling execution of solid computations by tracking.

Sorry, the diff of this file is not supported yet

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