loop-fns
TypeScript icon, indicating that this package has built-in type declarations

0.1.3 • Public • Published

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()

Readme

Keywords

Package Sidebar

Install

npm i loop-fns

Weekly Downloads

2

Version

0.1.3

License

MIT

Unpacked Size

16.5 kB

Total Files

14

Last publish

Collaborators

  • skulptur