
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
requestAnimationFrame pool to avoid busyness on the thread
This library is used in ember-in-viewport and ember-infinity.
window.requestAnimationFrame schedules and performs an animation before the next repaint, thus taking the guesswork out of being in sync with the user's browser readiness. It will perform the callback function 60 times per second, thus making the main thread quite busy. If you have hundreds of images on the page, it can be very painful on memory when you have hundreds of recurring handles on requestAnimationFrame
. This small library can dramatically reduce memory usage as it uses a single requestAnimationFrame.
While observing 20 images on a page:
npm install raf-pool --save
add
back the method to the raf-pool service.import RafPool from 'raf-pool';
const rafPool = new RafPool();
const callback = () => {
rafPool.add(element.id, callback);
};
callback();
// add an element to static administrator
rafPool.add(element.id, callback);
// Use in cleanup lifecycle hooks (if applicable) from the element being observed
rafPool.remove(element.id);
// Use in cleanup lifecycle hooks of your application as a whole
// This will remove the in memory data store holding onto all of the observers
rafPool.reset();
FAQs
requestAnimationFrame pool to avoid busyness on the thread
The npm package raf-pool receives a total of 18,092 weekly downloads. As such, raf-pool popularity was classified as popular.
We found that raf-pool 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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.