Comparing version 0.0.0 to 0.0.1
14
index.js
module.exports = raf | ||
var EE = require('events').EventEmitter | ||
, global = typeof window === 'undefined' ? this : window | ||
var _raf = | ||
this.requestAnimationFrame || | ||
this.webkitRequestAnimationFrame || | ||
this.mozRequestAnimationFrame || | ||
this.msRequestAnimationFrame || | ||
this.oRequestAnimationFrame || | ||
(this.setImmediate ? function(fn, el) { | ||
global.requestAnimationFrame || | ||
global.webkitRequestAnimationFrame || | ||
global.mozRequestAnimationFrame || | ||
global.msRequestAnimationFrame || | ||
global.oRequestAnimationFrame || | ||
(global.setImmediate ? function(fn, el) { | ||
setImmediate(fn) | ||
@@ -43,2 +44,3 @@ } : | ||
raf.polyfill = _raf | ||
raf.now = function() { return Date.now() } |
{ | ||
"name": "raf", | ||
"version": "0.0.0", | ||
"version": "0.0.1", | ||
"description": "requestAnimationFrame polyfill library", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -21,6 +21,7 @@ # raf | ||
## raf(element) -> event emitter | ||
## raf([optional element]) -> event emitter | ||
returns a event emitter that immediately starts emitting 'data' | ||
events representing animation frames for a given element. | ||
events representing animation frames for a given element (or for the entire | ||
window, if no element is passed). | ||
@@ -34,4 +35,8 @@ ## ee.pause() / ee.resume() | ||
## raf.polyfill | ||
the polyfilled `requestAnimationFrame` function. | ||
# license | ||
MIT |
2812
51
41