# callbag-tap

> Callbag operator that taps the source with the given function, but otherwise is a noop

Latest version **1.3.0** (published 2018-07-23) · MIT license · 0 weekly downloads

## Install

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

## 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.3.0 |
| Published | 2018-07-23 |
| First published | 2018-02-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | David Waller |
| Maintainers | krawaller |
| Keywords | callbag |

## Links

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

## Recent versions

- 1.3.0 (latest) — 2018-07-23
- 1.1.0 — 2018-05-05
- 1.0.2 — 2018-02-18
- 1.0.1 — 2018-02-14
- 1.0.0 — 2018-02-14

## README

# callbag-tap

[Callbag](https://github.com/callbag/callbag) operator that taps the source with the given function, but otherwise acts as a noop.

Therefore it is not the same as [forEach](https://github.com/staltz/callbag-for-each) which is a sink (that actively consumes sources).

`npm install callbag-tap`

You can tap data, error and completion respectively:

```js
const tapped = tap(dataTapFunc, errorTapFunc, completionTapFunc)(source);
```

## example

```js
const fromIter = require('callbag-from-iter');
const tap = require('callbag-tap');
const forEach = require('callbag-for-each');

const source = fromIter([1,2,3]);
const tapped = tap(x => console.log("tap", x))(source);
const sink = forEach(x => console.log("sink", x))(tapped);

// tap 1
// sink 1
// tap 2
// sink 2
// tap 3
// sink 3
```

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