1.0.3 • Published 6 years ago

rxjs-animation-loop v1.0.3

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

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
1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago