# callbag-timeout

> 👜 Callbag operator which errors if source does not emit before specified duration.

Latest version **1.0.1** (published 2018-11-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install callbag-timeout
pnpm add callbag-timeout
yarn add callbag-timeout
bun add callbag-timeout
```

## 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.1 |
| Published | 2018-11-13 |
| First published | 2018-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 4.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Mateusz Burzyński |
| Maintainers | andarist |
| Keywords | callbag, callbags |

## Links

- npm: https://www.npmjs.com/package/callbag-timeout
- Repository: https://github.com/Andarist/callbag-timeout
- Homepage: https://github.com/Andarist/callbag-timeout#readme
- Issues: https://github.com/Andarist/callbag-timeout/issues
- npm.io page: https://npm.io/package/callbag-timeout

## Recent versions

- 1.0.1 (latest) — 2018-11-13
- 1.0.0 — 2018-11-12

## README

# callbag-timeout

Callbag operator which errors if source does not emit before specified duration.

## Example

```js
import concatMap from 'callbag-concat-map'
import of from 'callbag-of'
import pipe from 'callbag-pipe'
import subscribe from 'callbag-subscribe'
import timeout from 'callbag-timeout'
import timer from 'callbag-timer'

// fake request
const makeRequest = ms =>
  pipe(
    timer(ms),
    map(() => 'Request completed.'),
  )

pipe(
  of(2000, 3000, 4000),
  concatMap(ms =>
    pipe(
      makeRequest(ms),
      timeout(3500),
    ),
  ),
  subscribe({
    next(val) {
      // will log 'Request completed.' twice
      console.log(val)
    },
    error(err) {
      // will be called for the 3rd (timed out) request
    },
  }),
)
```

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