
Security News
NIST Under Federal Audit for NVD Processing Backlog and Delays
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
request-frame-modern
Advanced tools
Optimal requestAnimationFrame & cancelAnimationFrame polyfill for modern development
If you need to support legacy browsers see requestFrame for full support from IE5.5+.
npm i request-frame-modern --save
yarn add request-frame-modern
import requestFrameModern from 'request-frame-modern'; // ES6
<script src="request-frame-modern.js"></script> // AMD, IIFE
const requestFrameModern = require('request-frame-modern'); // CJS
requestFrameModern( request | cancel | native ) request is default.
var request = requestFrameModern('request'); // window.requestAnimationFrame | setTimeout
var cancel = requestFrameModern('cancel'); // window.cancelAnimationFrame | cancelTimeout
requestFrameModern('native'); // re/ declares requestAnimationFrame & cancelAnimationFrame
Below is just an example of the requestAnimationFrame API, see links: MDN, MSDN & W3.
var requestId;
function something( useTimeStamp ){
// Do something here
requestId = requestFrameModern(something);
}
requestId = requestFrameModern(something); // Assigns Id & calls "something"
cancel(requestId); // Cancels frame request
request-frame-modern aims to provide an optimal development consistency with the use of animation timing functions across the large number of browsers and devices. This lib is ideal for those who may want to avoid re-assigning native functions, or avoid interfering with other libs that do. requestFrameModern() is purposely not a constructor. The intention is for requestAnimationFrame to be used once or few times during execution since multiple task are expected to be more efficient via a single requestAnimationFrame loop compared to several instances.
Just do it!
npm run test
To launch port 9999
Browser based testing for RAF is imperative
© 2016 Julien Etienne
FAQs
Optimal requestAnimationFrame & cancelAnimationFrame polyfill for modern development
The npm package request-frame-modern receives a total of 15 weekly downloads. As such, request-frame-modern popularity was classified as not popular.
We found that request-frame-modern demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.
Security News
TypeScript Native Previews offers a 10x faster Go-based compiler, now available on npm for public testing with early editor and language support.