# rxjs-animation-loop

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

Latest version **1.0.3** (published 2018-02-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install rxjs-animation-loop
pnpm add rxjs-animation-loop
yarn add rxjs-animation-loop
bun add rxjs-animation-loop
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2018-02-16 |
| First published | 2017-02-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Gareth Whittaker |
| Maintainers | garethwhittaker |
| Keywords | animation loop, game loop |

## Links

- npm: https://www.npmjs.com/package/rxjs-animation-loop
- Repository: https://github.com/garethwhittaker/rxjs-animation-loop
- Homepage: https://github.com/garethwhittaker/rxjs-animation-loop#readme
- Issues: https://github.com/garethwhittaker/rxjs-animation-loop/issues
- npm.io page: https://npm.io/package/rxjs-animation-loop

## Alternatives

- [@luma.gl/experimental](https://npm.io/package/@luma.gl/experimental.md) — 77.1K weekly downloads
- [persona-harness](https://npm.io/package/persona-harness.md) — 4.7K weekly downloads
- [@tsparticles/effect-bubble](https://npm.io/package/@tsparticles/effect-bubble.md) — 4.6K weekly downloads
- [f3d](https://npm.io/package/f3d.md) — 730 weekly downloads
- [spark-html-motion](https://npm.io/package/spark-html-motion.md) — 298 weekly downloads

## Recent versions

- 1.0.3 (latest) — 2018-02-16
- 1.0.2 — 2018-02-16
- 1.0.1 — 2018-02-16
- 1.0.0 — 2017-03-23
- 0.1.5 — 2017-02-24
- 0.1.4 — 2017-02-10
- 0.1.3 — 2017-02-08
- 0.1.2 — 2017-02-07
- 0.1.1 — 2017-02-05
- 0.1.0 — 2017-02-02

## README

# RxJS Animation Loop

This module provides a game / animation loop based upon [requestAnimationFrame](https://developer.mozilla.org/en-US/docs/Web/API/window/requestAnimationFrame).

## Installation and Usage

```sh
npm install rxjs-animation-loop
```

*Note: [rxjs](https://github.com/ReactiveX/rxjs) (5.x) is a [peer dependency](https://nodejs.org/en/blog/npm/peer-dependencies) of this package.*

```javascript
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:

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

---
_Source: https://npm.io/package/rxjs-animation-loop · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
