标签:efault com thunk handle export size 数据 ali ddl
store里面的index.js文件
1 import {createStore,combineReducers,applyMiddleware} from "redux" 2 import reduxThunk from "redux-thunk" 3 import user from "./reducers/user"/*团队合作各自引入自己的模块*/ 4 import {composeWithDevTools} from "redux-devtools-extension" 5 6 7 const reducers=combineReducers({ 8 user 模块在这里写入 9 }) 10 11 12 const store=createStore(reducers,composeWithDevTools(applyMiddleware(reduxThunk))) 13 14 15 export default store
1 import {handleActions} from "redux-actions" 2 3 const defaultState={ 4 5 } 6 7 8 9 export default handleActions({ 10 11 },defaultState)
在入口文件引入
import React from ‘react‘; import ReactDOM from ‘react-dom‘; import App from ‘./App‘; import store from "./store" import { Provider } from "react-redux" ReactDOM.render( <Provider store={store}>/*在这里注入store全局可以使用store*/ <App /> </Provider> , document.getElementById(‘root‘));
标签:efault com thunk handle export size 数据 ali ddl
原文地址:https://www.cnblogs.com/Bree/p/12003747.html