|
|
|
|
|
by patates
994 days ago
|
|
I use ppipe: https://github.com/egeozcan/ppipe Looks tidier to my eyes const newPipe = ppipe.extend({
divide (x, y) {
return x / y;
},
log(...params) {
console.log(...params);
return params[params.length - 1];
}
});
const res = await newPipe(10)
.pipe(x => x + 1)
.divide(_, 11)
.log("here is our x: ") //logs "here is our x: 1"
.pipe(x => x + 1) // 2
|
|