摘要: App.js:import React, { Component } from 'react';import PropTypes from 'prop-types'import { createStore } from 'redux'import { Provide... 阅读全文
posted @ 2018-10-11 16:49 徐同保 阅读(118) 评论(0) 推荐(0) 编辑
摘要: react-redux.js:import React, { Component } from 'react'import PropTypes from 'prop-types'export const connect = (mapStateToProps, mapD... 阅读全文
posted @ 2018-10-11 15:55 徐同保 阅读(268) 评论(0) 推荐(0) 编辑
摘要: App.js:import React, { Component } from 'react';import PropTypes from 'prop-types'import Header from './Header'function createStore (... 阅读全文
posted @ 2018-10-11 15:21 徐同保 阅读(179) 评论(0) 推荐(0) 编辑
摘要: 1.结合 context 和 storeimport React, { Component } from 'react';import PropTypes from 'prop-types'function createStore (reducer) { let s... 阅读全文
posted @ 2018-10-11 15:02 徐同保 阅读(374) 评论(0) 推荐(0) 编辑
摘要: 1.抽离 store 和监控数据变化 Redux架构模式 2.共享结构的对象提高性能 Redux架构模式 3.reducer Redux架构模式 ... 阅读全文
posted @ 2018-10-11 11:13 徐同保 阅读(247) 评论(0) 推荐(0) 编辑