3 var raf = require('./raf');
5 /* Animation-frame frequency debounce */
6 function debounce(fn, context) {
10 if (existing) raf.cancel(existing);
11 existing = raf(function() {
18 /* Only allow one instantiation per animation frame, on the trailing edge */
19 function throttle(fn, context) {
24 existing = raf(function() {
31 /* Perform an operation on each animation frame for the specified duration */
32 function intervalUntil(fn, ms) {
33 var until = Date.now() + ms;
38 if (Date.now() < until) {
49 intervalUntil: intervalUntil