Frame Scheduling
import frameScheduling, { P_IMPORTANT } from 'frame-scheduling';
frameScheduling(() => { Action() }, { priority: P_IMPORTANT });
Asynchronous running tasks in JavaScript. Supports priority and interrupt execution every 16 milliseconds, to achieve 60fps.
Usage
frameScheduling(callback: Function)
frameScheduling(callback: Function, { priority: number })
Options
priority: number = 5
It is possible to set the priority of the function. If the function has a low priority, then each execution skip adds +1 to the priority. Thus, low-priority tasks, when something is done.