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

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.

主站蜘蛛池模板: 雷山县| 威宁| 顺昌县| 云安县| 耒阳市| 宁波市| 临漳县| 广东省| 扬州市| 阜平县| 南漳县| 巴马| 吴江市| 滨海县| 延吉市| 措美县| 方山县| 阜宁县| 方正县| 白玉县| 沧州市| 济阳县| 宁陵县| 中江县| 左贡县| 曲麻莱县| 高青县| 大庆市| 青海省| 吉木乃县| 凤山县| 全椒县| 木兰县| 黔东| 从江县| 蓝田县| 通海县| 布拖县| 宝丰县| 龙游县| 常州市|