Skip to content

Instantly share code, notes, and snippets.

@zerobias
Created March 17, 2017 20:31
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zerobias/85ae4ea5182b41cce00eabfeb03b076d to your computer and use it in GitHub Desktop.
Save zerobias/85ae4ea5182b41cce00eabfeb03b076d to your computer and use it in GitHub Desktop.
Debug log inside of pipe
import { tap } from 'ramda'
const tapLog = (...tags) => tap(
(...values) => console.log(...tags,...values))
//USAGE
import { pipe } from 'ramda'
const debuggedSteps = pipe(
a => a + 1,
tapLog('first log'),
b => [ 0, b ],
tapLog('second log'),
c => c.length
)
debuggedSteps(0)
// => 2
// -> first log 1
// -> second log [ 0, 1 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment