You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

main-thread-scheduling

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

main-thread-scheduling - npm Package Compare versions

Comparing version

to
7.1.0

2

package.json
{
"name": "main-thread-scheduling",
"version": "7.0.0",
"version": "7.1.0",
"description": "Fast and consistently responsive apps using a single function call",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -12,2 +12,8 @@ import state from './state';

var _a, _b;
// - in Node.js context return immediately
// - this way we also support test environments (without jsdom added)
// - support for scheduling in Node.js is still under consideration for future versions
if (typeof requestAnimationFrame === 'undefined') {
return false;
}
// #performance, `performance.now()` is around 40% slower. also `Date.now()` is accurate enough

@@ -14,0 +20,0 @@ // for our use case

@@ -6,8 +6,2 @@ import yieldControl from './yieldControl';

export default function yieldOrContinue(priority) {
// - in Node.js context return immediately
// - this way we also support test environments (without jsdom added)
// - support for scheduling in Node.js is still under consideration for future versions
if (typeof requestAnimationFrame === 'undefined') {
return Promise.resolve();
}
if (isTimeToYield(priority)) {

@@ -14,0 +8,0 @@ return yieldControl(priority);