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

raf-loop

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

raf-loop

a minimal requestAnimationFrame render loop

1.1.3
latest
Source
npm
Version published
Weekly downloads
963
-24.05%
Maintainers
1
Weekly downloads
 
Created
Source

raf-loop

stable

A minimal requestAnimationFrame render loop for node and the browser, using high-performance timing where possible.

var loop = require('raf-loop')

var engine = loop(function(dt) {
    // delta time in milliseconds 
}).start()

Usage

NPM

engine = loop([fn])

Creates a new loop with an optional function to receive tick events. The function will be called with delta time as the first parameter, in milliseconds.

engine.start()

Starts the render loop and returns this engine, for chaining.

engine.stop()

Stops the render loop and cancels the currently requested animation frame.

engine.on('tick', fn)

Attaches another function to the render loop.

License

MIT, see LICENSE.md for details.

Keywords

raf

FAQs

Package last updated on 29 May 2015

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