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

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.

主站蜘蛛池模板: 昭苏县| 汝南县| 微博| 理塘县| 阳山县| 滦南县| 邵阳县| 丰都县| 涟水县| 从江县| 鄯善县| 克山县| 芦山县| 白朗县| 景谷| 奈曼旗| 三台县| 桃园市| 敖汉旗| 宝坻区| 焦作市| 保靖县| 固镇县| 南康市| 冕宁县| 雅安市| 嘉峪关市| 正镶白旗| 锡林郭勒盟| 德兴市| 平南县| 龙门县| 宿迁市| 昌吉市| 贵德县| 梧州市| 亳州市| 资源县| 奉化市| 阿克| 绵竹市|