Socket
Socket
Sign inDemoInstall

request-animation-frame-timeout

Package Overview
Dependencies
2
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    request-animation-frame-timeout

setTimeout() via requestAnimationFrame()


Version published
Weekly downloads
11K
increased by6.5%
Maintainers
1
Install size
28.8 kB
Created
Weekly downloads
 

Readme

Source

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.

  • Fix Chrome setTimeout throttling
  • Issue 570845: setInterval and setTimeout stop during input when timer callbacks are expensive

Use

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

Keywords

FAQs

Last updated on 10 Sep 2020

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc