摘要: Promise Promise.resolve(x) 可以看作是 new Promise(resolve ⇒ resolve(x)) 的简写,可以用于快速封装字面量对象或其他对象,将其封装成 Promise 实例 返回一个Promise对象,使用该对象来注册处理结果和错误的回调 同时可以串联.the 阅读全文
posted @ 2021-01-28 16:57 rentu 阅读(149) 评论(0) 推荐(0) 编辑
摘要: 前置知识 Redux Rematch:Redux 基础上的改进 更简洁的代码,避免大量的冗余 不用写 action.type,actionCreate 其实就是把这些东西写到了 model 里而已 文档中的描述十分的棒,写的是真的好 理解模型与回答几个问题一样简单: 我的初始 state 是什么? 阅读全文
posted @ 2021-01-28 14:45 rentu 阅读(578) 评论(0) 推荐(0) 编辑
摘要: React 和 Redux 的连接 数据流 进行一次数据的传递来再次描述整个过程 store.dispatch(action) 向store传递action,描述发生事件 {type: , payload: } store调用传入的reducer store收到action之后,会将当前的state 阅读全文
posted @ 2021-01-28 14:16 rentu 阅读(84) 评论(1) 推荐(0) 编辑
摘要: 新类型 元组(Tuple) // Declare a tuple type let x: [string, number]; // Initialize it x = ["hello", 10]; // OK // Initialize it incorrectly x = [10, "hello" 阅读全文
posted @ 2021-01-28 14:15 rentu 阅读(98) 评论(0) 推荐(0) 编辑