rxjs-animation-loop

1.0.3 • Public • Published

RxJS Animation Loop

This module provides a game / animation loop based upon requestAnimationFrame.

Installation and Usage

npm install rxjs-animation-loop

Note: rxjs (5.x) is a peer dependency of this package.

import animationLoop from 'rxjs-animation-loop'

const gameLoop = animationLoop()

gameLoop.start()

const gameLoopSubscription = gameLoop.subscribe(() => {
    // code to perform each animation frame
})

// several levels later ...

gameLoopSubscription.unsubscribe()

gameLoop.stop()

Further examples are provided within the src directory. View the output of these with:

npm run example-multiple-subscribers
npm run example-pausing-game-loop

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.30latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.30
1.0.20
1.0.10
1.0.00
0.1.50
0.1.40
0.1.31
0.1.20
0.1.10
0.1.00

Package Sidebar

Install

npm i rxjs-animation-loop

Weekly Downloads

1

Version

1.0.3

License

ISC

Unpacked Size

10.6 kB

Total Files

11

Last publish

Collaborators

  • garethwhittaker