0.6.1 • Published 3 months ago

@masatomakino/raf-ticker v0.6.1

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

RAF-ticker

A simple ticker with requestAnimationFrame.

MIT License CI_Main Maintainability Test Coverage

ReadMe Card

Demo

Demo page

Open the console from your browser's developer tools.

Getting Started

Install

npm i @masatomakino/raf-ticker -D

How to use

import { RAFTicker } from "@masatomakino/raf-ticker";

Just import and RAFTicker starts.

RAFTicker.on("tick", (e) => {
  console.log(e);
});

RAFTicker dispatches events every frame.

API document

Why is this package necessary?

Unification of requestAnimationFrame improves rendering performance.

https://stackoverflow.com/questions/17103785/multiple-requestanimationframe-performance

If you use multiple animation modules together, setting up a render loop in each module will increase the cost of callbacks.

Warning Performance improvement from unifying requestAnimationFrame depends on the browser implementation. In future versions of the browser, this approach may result in performance degradation. Be sure to check performance in your actual environment.

License

MIT licensed.

0.6.1

3 months ago

0.6.0

4 months ago

0.5.3

9 months ago

0.5.2

11 months ago

0.5.0

12 months ago

0.5.1

11 months ago

0.4.1

1 year ago

0.4.0

1 year ago

0.4.2

1 year ago

0.3.0

1 year ago

0.3.1

1 year ago

0.2.10

2 years ago

0.2.9

2 years ago

0.2.8

2 years ago

0.2.7

2 years ago