goldenyz / raf-after

Invoke the callback after the next repaint, while the requestAnimationFrame invokes the callback before the next repaint

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

raf-after Build Status npm npm downloads

Invoke the callback after the next repaint, while the requestAnimationFrame invokes the callback before the next repaint.

Usage

  1. Install the package npm install raf-after -S
  2. Import the module in the place you want to use:
import rafAfter from 'raf-after';

rafAfter(function () => {
  // do what you want after next repaint
});

About

Invoke the callback after the next repaint, while the requestAnimationFrame invokes the callback before the next repaint

License:MIT License


Languages

Language:JavaScript 100.0%