Created
March 17, 2017 20:31
-
-
Save zerobias/85ae4ea5182b41cce00eabfeb03b076d to your computer and use it in GitHub Desktop.
Debug log inside of pipe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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