main-thread-scheduling
Advanced tools
Comparing version 7.1.0 to 8.0.0
{ | ||
"name": "main-thread-scheduling", | ||
"version": "7.1.0", | ||
"version": "8.0.0", | ||
"description": "Fast and consistently responsive apps using a single function call", | ||
@@ -60,3 +60,3 @@ "license": "MIT", | ||
"eslint": "^8.17.0", | ||
"eslint-config-strictest": "^0.4.0", | ||
"eslint-config-strictest": "^0.5.0", | ||
"eslint-formatter-pretty": "^4.0.0", | ||
@@ -63,0 +63,0 @@ "eslint-plugin-promise": "^6.0.0", |
import state from './state'; | ||
import hasValidContext from './hasValidContext'; | ||
// #performance | ||
@@ -12,6 +13,3 @@ // calling `isTimeToYield()` thousand of times is slow. `lastCall` helps to run logic inside of | ||
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') { | ||
if (!hasValidContext()) { | ||
return false; | ||
@@ -18,0 +16,0 @@ } |
import state from './state'; | ||
import isTimeToYield from './isTimeToYield'; | ||
import requestNextTask from './requestNextTask'; | ||
import hasValidContext from './hasValidContext'; | ||
import { createTask, nextTask, removeTask } from './tasks'; | ||
@@ -18,6 +19,3 @@ import { cancelPromiseEscape, requestPromiseEscape } from './promiseEscape'; | ||
export default async function yieldControl(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') { | ||
if (!hasValidContext()) { | ||
return; | ||
@@ -24,0 +22,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23721
28
385