September 2018
Intermediate to advanced
302 pages
7h 17m
English
The next interesting pattern I see in code written by skilled Ramda users is so-called pointfree code. It means there is only one single place where we pass all data. As beautiful as it sounds, I wouldn't recommend you to be so strict about it. But there is a nice thing we can derive from this approach.
Consider refactoring your code from this:
const myHoc = SomeComponent => R.compose(withLogger,withAnalytics, withRouter)(SomeComponent)
You could refactor it to this:
const myHoc = R.compose(withLogger,withAnalytics, withRouter)
This will hide the obvious part. The most common problem is that it starts to act like a magic box, where only we know how to pass data to it. If you use a type system such as TypeScript ...
Read now
Unlock full access