DEV Community

Discussion on: Beautiful Functions: Compose

Collapse
 
pcjmfranken profile image
Peter Franken

Very good explanation!

I never really understood or even cared about the concept until I saw it used in production (all those wasted years!). If you have time, maybe add a real-world practical use example for stragglers like me 😉

Collapse
 
jethrolarson profile image
Jethro Larson • Edited

I showed one which is

const fetchStuff = () =>
  fetch(...).then(data => parseData(validate(data))
Enter fullscreen mode Exit fullscreen mode

to

const fetchStuff = () =>
  fetch(...).then(B(parseData)(validate))
Enter fullscreen mode Exit fullscreen mode