Created
April 13, 2020 11:45
-
-
Save sverweij/1fa3af39ec085f7ae16bf620500737a4 to your computer and use it in GitHub Desktop.
tee.js - console.log debugging for functional chains
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
// for console.log debugging of functional chains | |
const tee = (pX, pN) => { | |
console.error(pN, pX); | |
return pX; | |
}; | |
// plug into chains like so | |
lElaborateArray | |
.filter(lowPass) | |
.map(doStuff) | |
.map(tee) | |
.reduce(interestinglyeReduce); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment