re: Turn any non fluent API into a fluent one - tap tap tap VIEW POST

FULL DISCUSSION
 

This only works for mutable operations on data structures. Image you use the filter function on the array (or map or reduce).

const { tap } = require('taptaptap');

const arr = [1, 2, 3];
const mappedArr = tap(arr).map(val => val * 2);

mappedArr[0] === arr[0] // the value returned from the map function is the old array
 
code of conduct - report abuse