request-animation-frame-timeout

1.0.0 • Public • Published

request-animation-frame-timeout

Rationale

For some weird reason, in Chrome, setTimeout() would lag up to a second (or more) behind. Turns out, Chrome developers have deprecated setTimeout() API entirely without asking anyone. Replacing setTimeout() with requestAnimationFrame() can work around that Chrome bug. The timer-freezing behavior of Chrome is inherently retarded, so this workaround wouldn't be required if they designed their corporate web browser properly.

Use

npm install request-animation-frame-timeout --save
import { setTimeout, clearTimeout } from 'request-animation-frame-timeout'

Package Sidebar

Install

npm i request-animation-frame-timeout

Weekly Downloads

11,361

Version

1.0.0

License

MIT

Unpacked Size

7.22 kB

Total Files

8

Last publish

Collaborators

  • catamphetamine