New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@adoratorio/aion

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@adoratorio/aion

A js RAF engine

  • 0.3.11
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created
Source

Aion

A js RAF engine

Usage

import Aion from '@adoratorio/aion';

// Create the engine
const engine = new Aion({
  autostop: true // Set if the engine stop himself after last funciton removal
});
const fn = () => {
  // Awesome stuff executed each frame
};
// Add a function to the quee and take the id
const id = engine.add(fn);
// Add a function by manually setting the id
engine.add(fn, 'myId');
// Add a function and make it executed at half the speed (jump odd frames)
engine.add(fn, 'heavyId', true);

// Time to start the engine
engine.start();

// Remove a function by id, if autostop is true the engine will auto-stop when the last function is removed
engine.remove(id);

// Or stop it manually
engine.stop();
// By passing true to force you can also cancel the last queed frame just to be sure
// it won't be executed, otherwise the already requested frames will be executed
engine.stop(true);

// You can also check the running state by testing the .stopped property
if (!engine.stopped) {
  engine.stop();
}

Keywords

FAQs

Package last updated on 12 Apr 2022

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

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