基于新上下文 API 构建的 React 存储
React 存储是基于 新的上下文 API 构建的
store.js
import createStore from 'react-waterfall'
const config = {
initialState: { count: 0 },
actionsCreators: {
increment: ({ count }) => ({ count: count + 1 }),
},
}
export const { Provider, connect, actions } = createStore(config)App.js
import { connect, Provider, actions } from './store'
let Count = ({ count }) => count
Count = connect(({ count }) => ({ count }))(Count)
const App = () => (
+
)在开发过程中,redux-devtools会自动启用。请安装 扩展插件。
https://github.com/didierfranc/react-waterfall/graphs/contributors
暂无开放 Issues,或尚未同步最近议题。