# @abernier/loop

> ♻️

Latest version **1.0.4** (published 2021-12-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install @abernier/loop
pnpm add @abernier/loop
yarn add @abernier/loop
bun add @abernier/loop
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.4 |
| Published | 2021-12-16 |
| First published | 2020-10-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Antoine BERNIER |
| Maintainers | abernier |

## Links

- npm: https://www.npmjs.com/package/@abernier/loop
- Repository: https://github.com/abernier/loop
- Issues: https://github.com/abernier/loop/issues
- npm.io page: https://npm.io/package/@abernier/loop

## Recent versions

- 1.0.4 (latest) — 2021-12-16
- 1.0.3 — 2021-12-16
- 1.0.1 — 2020-10-13
- 1.0.0 — 2020-10-13

## README

[![NPM version](https://img.shields.io/npm/v/@abernier/loop.svg?style=flat)](https://www.npmjs.com/package/@abernier/loop)

# INSTALL

```js
import Loop from 'https://unpkg.com/@abernier/loop@1.0.4'
```

# Usage

At max speed (`requestAnimationFrame`):

```js
const myLoop = new Loop((t1, t0) => {
  console.log(`dt: ${t1 - t0}`)
})

myLoop.start()

// ...

myLoop.stop()
```

At given speed (`setTimeout`):

```js
const myLoop = new Loop((t1, t0) => {
  console.log(`dt: ${t1 - t0}`)
}, 1000)

myLoop.start()

// ...

myLoop.stop()
```

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