node package manager


Promisified requestAnimationFrame with Q

DEPRECATED in favor of raf.


A simple Promise wrapper for requestAnimationFrame based on Q.

This library intends to promisify requestAnimationFrame.

Checkout the Annotated Source Code

QanimationFrame is a function which takes a function and returns a promise containing it's return value (after one frame).

QanimationFrame(f: function) => DOM.Element

var elt = document.createElement("div");
elt.innerHTML = "Hello world";
var doSomething = QanimationFrame(function () { = '50px'; = '50px';
  return elt;
doSomething.then(function (elt) {
  // style changes are rendered 
  var boundingBox = elt.getBoundingClientRect(elt);
  console.log(boundingBox.right - boundingBox.left);

via npm.

npm install qanimationframe

via bower

bower install qanimationframe

All browsers are supported (including IE).