Skip to content

Callbag operator that logs values to the console midstream for simpler debugging

Notifications You must be signed in to change notification settings

willisplummer/callbag-trace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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))
)

About

Callbag operator that logs values to the console midstream for simpler debugging

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published