redux
每天进步一点点,实现属于自己的小型redux
moe_王
Again is a gain
展开
-
<Redux>实现MyRedux(三)
实现MyRedux系列 实现MyRedux(一) 实现MyRedux(二) 未完待续 现在通过前边两部分,我们实现了一个通用的createStore: function createStore (state, stateChanger) { const listeners = [] const subscribe = (listener) => listeners.push(l...原创 2020-02-22 10:35:43 · 178 阅读 · 2 评论 -
<Redux>实现myRedux(二)
现在我们继续实现属于我们自己的redux ps:没有看过第一篇的童鞋建议先看 第一篇再看这篇 纯函数(Pure Function) https://blog.csdn.net/qq_40766509/article/details/104405353#comments 简单说,一个函数的返回结果只依赖于他的参数,并且执行过程中没有副作用,就是纯函数 从上面看,纯函数需要两个条件: 函数的返...原创 2020-02-21 11:07:31 · 131 阅读 · 0 评论 -
<Redux>实现MyRedux(一)
说在前面 为了学习redux,仅仅实现了store,createStore,reducer等部分基本功能 现在开始忘掉一切 首先用create-react-app新建一个项目,修改public/index.html下的页面结构 <body> <div id='title'></div> <div id='content'><...原创 2020-02-20 09:42:42 · 1423 阅读 · 2 评论