Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
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 7.1.0 to 8.0.0

src/hasValidContext.d.ts

4

package.json
{
"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 @@ }

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