🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

scheduling

Package Overview
Dependencies
Maintainers
0
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scheduling

A enterframe tool

1.4.4
latest
Source
npm
Version published
Weekly downloads
17
88.89%
Maintainers
0
Weekly downloads
 
Created
Source

Scheduler

A simple javascript tool for enterframe tasks.

Installation

npm install scheduling

Usage

Adding enterframe task :

import Scheduler from 'scheduling';
let enterframeID = Scheduler.addEF(loop);

function loop() {
    ...
}

Remove enterframe task :

Scheduler.removeEF(enterframeID);

Delay call

Scheduler.delay(delayFunc, 'hello', 500);
function delayFunc(mStr) {
    console.log(mStr);  //  console output 'hello'
}

Calling in the next frame :

checkLoaded();

function checkLoaded() {
    if(!loaded) {
        Scheduler.next(checkLoaded);
        return;
    }
    
    ... //  loaded
}

Green threading

Scheduler.defer(func, [params]);

Keywords

enterframe

FAQs

Package last updated on 18 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts