callbag-trace

1.0.1 • Public • Published

callbag-trace

Callbag operator for debugging that allows you to pass in a function (e.g. console.log) that will be called on each value as it is passed through.

yarn --dev add callbag-trace

example

const trace = require('callbag-trace');
const {forEach, fromEvent, map, filter, pipe} = require('callbag-basics');

const accum = []

pipe(
  fromEvent(document, 'click'),
  filter(ev => ev.target.tagName === 'BUTTON'),
  trace(console.log),
  map(ev => ev.target.id),
  forEach(id => accum.push(id))
)

Readme

Keywords

Package Sidebar

Install

npm i callbag-trace

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

2.61 kB

Total Files

5

Last publish

Collaborators

  • willisplummer