-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Open
Description
Hello, not really an issue but something I am just unsure about.
const compose = (...fns) =>
(arg) =>
fns.reduce(
(composed, f) => f(composed),
arg
)
In chapter 3 compose is shown to use the array reduce function, along with being discussed that way in the next.
Doesn't this differ from tradition convention though. Using reduce is traditionally a pipe as it operating left-to-right. The name compose is usually used for a right-to-left pipe where reduceRight is used. Just including the following link as an example of what I mean: https://aparnajoshi.netlify.app/javascript-pipe-and-compose-functions
Obviously is this book compose is being used for reduce operations acting left-to-right.
Metadata
Metadata
Assignees
Labels
No labels