Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
@gladeye/af
Advanced tools
Animation Frame class & instance with read and write cycles to maximise performance
Simple animation frame class with read and write cycles to seperate out logic and draws to improve performance.
Reads will run before Writes.
npm install @gladeye/af
As a singleton. This should be the main way this is used.
import { af } from '@gladeye/af'; // lowercase af
let count = 0;
function update(){
count ++;
}
const animFram = af();
animFram.addRead( update );
animFramf.removeRead( update );
Or you may extend the class.
import { AF } from '@gladeye/af'; // uppercase AF
class ewAF extends AF{
}
- start()
- stop()
- addRead( fn )
Adds function to the read cycle. These will run before the write functions
- addWrite( fn )
Adds function to the write cycle. These will run after the read functions
- removeRead( fn )
Removes function from the read cycle
- removeWrite( fn )
Removes function from the write cycle
- onNextRead( fn )
Adds function to run once on the next read cycle
- onNextWrite( fn )
Adds function to run once on the next write cycle
FAQs
Animation Frame class & instance with read and write cycles to maximise performance
We found that @gladeye/af demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 6 open source maintainers 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
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.