0.0.2 • Published 5 years ago

@saber2pr/interval v0.0.2

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

@saber2pr/interval

Interval use requestAnimationFrame.

npm install @saber2pr/interval

API

const interval = new Interval() // delta is 16

const interval = new Interval(1000) // delta is 1000

Interval.push

const update1 = time => console.log('update1', time)
const update2 = time => console.log('update2', time)

interval.push(update1, update2)

interval.remove

const update1 = time => console.log('update1', time)

interval.remove(update1)

interval.setDelta

interval.setDelta(500) // delta is changed to 500

interval.execute

interval.execute() // interval is starting...

interval.cancel

interval.cancel() // interval is canceled.

Author

saber2pr