Skip to content

hughsk/dauber

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dauber deprecated

Deprecated

Pooled requestAnimationFrame wrapper, designed for short bursts of animation as opposed to a constant loop. Useful for DOM/SVG-based animations where CSS transitions aren't applicable.

Usage

NPM

dauber(loopfn)

Calls loopfn each frame, until the function returns false.

For example, to run an animation for five frames:

var dauber = require('dauber')
var el = document.getElementById('el')
var n = 0

dauber(function() {
  el.setAttribute('d', 'some SVG path value')
  return ++n < 5
})

License

MIT. See LICENSE.md for details.

About

Pooled requestAnimationFrame wrapper, designed for short bursts of animation as opposed to a constant loop.

Resources

License

Stars

Watchers

Forks

Packages

No packages published