# use-callbag

> 👜 Use callbag as React hook.

Latest version **1.0.0** (published 2021-01-23) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2021-01-23 |
| First published | 2018-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 34 |
| Author | Mateusz Burzyński |
| Maintainers | andarist |

## Links

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

## Dependencies (2)

- [callbag](https://npm.io/package/callbag.md) ^1.4.0
- [callbag-subscribe](https://npm.io/package/callbag-subscribe.md) ^1.5.1

## Recent versions

- 1.0.0 (latest) — 2021-01-23
- 0.2.0 — 2018-11-04
- 0.1.2 — 2018-10-27
- 0.1.1 — 2018-10-27
- 0.1.0 — 2018-10-27

## README

# use-callbag

Use callbag as React hook.

## Example

```jsx
import interval from 'callbag-interval'
import map from 'callbag-map'
import pipe from 'callbag-pipe'
import useCallbag from 'use-callbag'

export default function Counter({ initialCount }) {
  const count = useCallbag(initialCount, () =>
    pipe(
      interval(1000),
      map(i => initialCount + i + 1),
    ),
  )
  return <span>{`Counter: ${count}`}</span>
}
```

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