DEV Community

Discussion on: I've used the pipe() function 2,560 times and I can tell you it's good!

Collapse
 
ivan7237d profile image
Ivan Novikov

Could you tell a bit more about what you mean by "compose pattern"?

Collapse
 
gnomff_65 profile image
Timothy Ecklund • Edited

Compose is similar to pipe but you don't pass a value at the front so the result is another function, not a value. It's for combining small functions into more complicated functions that you can call later. Check out flow in fp-ts for some examples.

Thread Thread
 
ivan7237d profile image
Ivan Novikov

Oh I see - I talk a little bit about this function in the first section where I call it ltrCompose. It might well be a good option for folks who use fp-ts or Ramda, but personally I've moved away from it.