Package Exports
- raf-manager
- raf-manager/build/RAFManager.min.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (raf-manager) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
RAFManager

Overview
RAFManager is a lightweight and efficient animation manager built on top of the requestAnimationFrame API. It provides precise global control over the addition and removal of animations.
Key Features
- Minimalistic: Implemented in just a few dozen lines of code
- Easy Integration: Use as a foundation for animation projects or integrate where needed
- Global Control: Effortlessly manage animations across your entire application
Installation
Browser
Include the script directly in your HTML file:
<script src="js/RAFManager.min.js"></script>npm
Install using npm:
npm install raf-manager --saveThen import it in your project:
import RAFManager from 'raf-manager';API
Add an Animation Function - Auto Start
RAFManager.add(func, fps, param);Remove an Animation Function - Auto Stop
RAFManager.remove(func);Force Start and Stop
RAFManager.start();
RAFManager.stop();Usage Demo
RAFManager.add((title) => {
top++;
const node = this.inputRef.current;
node.innerHTML = title;
node.style.top = top + 'px';
}, 25, 'hello world!');RAFManager.add(func1, 2);
RAFManager.add(func2, 3.5);
RAFManager.add(func3, 10.5);Build
Node.js is a dependency. Use the terminal to install it with npm:
npm install
npm run buildES6 Lint
npm run lintLicense
RAFManager is released under the MIT License. http://www.opensource.org/licenses/mit-license