Comparing version 0.0.1 to 0.0.2
20
index.js
var ease = require('ease-component') | ||
, raf = require('raf').polyfill | ||
@@ -9,6 +10,5 @@ module.exports = ease_filter | ||
, target = {} | ||
, rate = 10 | ||
, ms = 1 | ||
, timer | ||
, start | ||
, wait | ||
, prev | ||
@@ -22,12 +22,15 @@ | ||
var update_fn = this.create_part(parts[1] || 'linear', function(d) { | ||
fn = d || 'linear' | ||
animate() | ||
}) | ||
var update_rate = this.create_part(parts[2] || '10', function(d) { | ||
animate() | ||
}) | ||
function animate() { | ||
if(wait) { | ||
return | ||
} | ||
function animate() { | ||
clearTimeout(timer) | ||
timer = setTimeout(update, rate) | ||
wait = raf(function() { | ||
wait = null | ||
update() | ||
}) | ||
} | ||
@@ -42,3 +45,2 @@ | ||
update_fn(ctx) | ||
update_rate(ctx) | ||
} | ||
@@ -45,0 +47,0 @@ |
{ | ||
"name": "altr-ease", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "easing filter for altr", | ||
@@ -20,4 +20,5 @@ "main": "index.js", | ||
"dependencies": { | ||
"ease-component": "1.0.0" | ||
"ease-component": "1.0.0", | ||
"raf": "0.1.1" | ||
} | ||
} |
68
3754
2