# callbag-defer

> 👜 Callbag which creates a source from a given factory when sink subscribes.

Latest version **1.1.0** (published 2019-02-10) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-02-10 |
| First published | 2018-11-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 2.5 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-defer
- Repository: https://github.com/Andarist/callbag-defer
- Homepage: https://github.com/Andarist/callbag-defer#readme
- Issues: https://github.com/Andarist/callbag-defer/issues
- npm.io page: https://npm.io/package/callbag-defer

## Dependencies (3)

- [callbag](https://npm.io/package/callbag.md) ^1.2.0
- [callbag-lazy](https://npm.io/package/callbag-lazy.md) ^2.0.1
- [callbag-flatten](https://npm.io/package/callbag-flatten.md) ^1.4.0

## Recent versions

- 1.1.0 (latest) — 2019-02-10
- 1.0.0 — 2018-11-10

## README

# callbag-defer

Callbag which creates a source from a given factory when sink subscribes.

## Example

```js
import defer from 'callbag-defer'
import forEach from 'callbag-for-each'
import fromEvent from 'callbag-from-event'
import interval from 'callbag-interval'
import pipe from 'callbag-pipe'

pipe(
  defer(() =>
    Math.random() > 0.5 ? fromEvent(document, 'click') : interval(1000),
  ),
  forEach(value => {
    // value being either click event or a number
  }),
)
```

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