Skip to content

Functions to help with your looping needs for animated graphics and beyond.

License

Notifications You must be signed in to change notification settings

skulptur/loop-fns

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

loop-fns

A lightweight solution for looping with great performance and control.

Get started

Install

yarn add loop-fns
# or
npm install --save loop-fns

Use

import { loopFrames } from 'loop-fns'

const props = loopFrames((props) => {
  // your graphics update logic...

  // you can also control the loop within the callback
  if (props.currentFrame === 10) {
    props.stop()
  }
}, 30) // limit to 30fps

props.start()

About

Functions to help with your looping needs for animated graphics and beyond.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published