4 ms·
My library adds the piped value as the last parameter but if you read the docs, you'd see that you can use a placeholder to change its place: ppipe([1, 2,
by egeozcan 7y ago
My library adds the piped value as the last parameter but if you read the docs, you'd see that you can use a placeholder to change its place:
ppipe([1, 2, 3, 4]).pipe(Enum.filter, _, x => x % 2 === 0)
Not that filter fn in js is in the prototype of arrays so you'd need to extract it. There's a shortcut when using my library though:
ppipe([1,2,3]).filter(x => x > 2)
I made the practical decision to provide prototype functions from the piped value while chaining.