2 ms·
I use a similar pattern in my typescript code by using the Remeda library[0]. Like the patterns described in the article, the util functions can be used in both
by ozuly 2y ago
I use a similar pattern in my typescript code by using the Remeda library[0]. Like the patterns described in the article, the util functions can be used in both a one-off data-first way:
R.map(arr, (x) => x + 1)
and as part of a pipe in a data-last way:
R.pipe(
[0, 1, 2, 3, 4, 5, 6],
R.map((x) => x + 1),
R.filter((x) => x % 2 === 0),
R.take(1)
)
I've really enjoyed using it and would recommend it to anyone who would like to write their typescript in a more functional way.
[0] https://remedajs.com/ https://remedajs.com/