官术网_书友最值得收藏!

Compositions

A composition is a very important concept of functional programming; it is how we create a higher-order function by consuming and combining simpler functions.

Let's just use the sum function that we defined previously. We can split the sum function into the following composition:

const sum = a => b => a + b
sum(2)(5)

Any function can be transformed into a composable function via the concept of currying. Explaining these fundamental functional concepts is beyond the scope of this book, and we suggest that you get familiar with functional terms as much as possible, in order to get a full understanding of Redux and React. We will consume a composition function from Redux, called compose, in upcoming chapters.

主站蜘蛛池模板: 宣化县| 大余县| 孝昌县| 灵丘县| 哈尔滨市| 双桥区| 晋宁县| 奉节县| 东兴市| 佛山市| 连城县| 额尔古纳市| 太原市| 南华县| 华宁县| 东港市| 宜章县| 兴和县| 山东| 新安县| 越西县| 宜昌市| 双桥区| 全椒县| 灵宝市| 荃湾区| 临湘市| 台中县| 武汉市| 普安县| 蒙城县| 会昌县| 五常市| 富川| 利辛县| 竹北市| 岳西县| 德令哈市| 武邑县| 嘉兴市| 宁海县|