Commit c8cea602 by hfpp2012 yinsigan

初始化redux

1 parent d6cc3c33
...@@ -19,7 +19,9 @@ ...@@ -19,7 +19,9 @@
"react-alert": "^2.0.1", "react-alert": "^2.0.1",
"react-bootstrap": "^0.31.0", "react-bootstrap": "^0.31.0",
"react-dom": "^15.5.4", "react-dom": "^15.5.4",
"react-redux": "^5.0.5",
"react-router-dom": "^4.1.1", "react-router-dom": "^4.1.1",
"redux": "^3.6.0",
"webpack": "^2.5.1", "webpack": "^2.5.1",
"webpack-dev-server": "^2.4.5" "webpack-dev-server": "^2.4.5"
}, },
......
export const UPDATE_LANE = 'UPDATE_LANE';
export function updateLane(updatedLane) {
return {
type: UPDATE_LANE,
...updatedLane
};
};
...@@ -8,11 +8,20 @@ import { ...@@ -8,11 +8,20 @@ import {
import RegionalDesign from './components/RegionalDesign' import RegionalDesign from './components/RegionalDesign'
import { createStore } from 'redux'
import { Provider, connect } from 'react-redux'
import rootReducer from './reducers'
const store = createStore(rootReducer)
ReactDOM.render( ReactDOM.render(
<Provider store={store}>
<Router handler={Spd} history={Router}> <Router handler={Spd} history={Router}>
<Spd> <Spd>
<Route path="/web/regional_design/:id" component={RegionalDesign} /> <Route path="/web/regional_design/:id" component={RegionalDesign} />
</Spd> </Spd>
</Router>, </Router>
</Provider>,
document.getElementById('root') document.getElementById('root')
); );
const header = (state = {}, action) => {
return state;
}
export default header
import { combineReducers } from 'redux';
import header from './header';
const rootReducer = combineReducers({
header
});
export default rootReducer;
...@@ -1461,6 +1461,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: ...@@ -1461,6 +1461,14 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4:
safe-buffer "^5.0.1" safe-buffer "^5.0.1"
sha.js "^2.4.8" sha.js "^2.4.8"
create-react-class@^15.5.3:
version "15.5.3"
resolved "http://registry.npm.taobao.org/create-react-class/download/create-react-class-15.5.3.tgz#fb0f7cae79339e9a179e194ef466efa3923820fe"
dependencies:
fbjs "^0.8.9"
loose-envify "^1.3.1"
object-assign "^4.1.1"
cross-spawn@^3.0.0: cross-spawn@^3.0.0:
version "3.0.1" version "3.0.1"
resolved "http://registry.npm.taobao.org/cross-spawn/download/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982" resolved "http://registry.npm.taobao.org/cross-spawn/download/cross-spawn-3.0.1.tgz#1256037ecb9f0c5f79e3d6ef135e30770184b982"
...@@ -2544,7 +2552,7 @@ hoek@2.x.x: ...@@ -2544,7 +2552,7 @@ hoek@2.x.x:
version "2.16.3" version "2.16.3"
resolved "http://registry.npm.taobao.org/hoek/download/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed" resolved "http://registry.npm.taobao.org/hoek/download/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"
hoist-non-react-statics@^1.2.0: hoist-non-react-statics@^1.0.3, hoist-non-react-statics@^1.2.0:
version "1.2.0" version "1.2.0"
resolved "http://registry.npm.taobao.org/hoist-non-react-statics/download/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb" resolved "http://registry.npm.taobao.org/hoist-non-react-statics/download/hoist-non-react-statics-1.2.0.tgz#aa448cf0986d55cc40773b17174b7dd066cb7cfb"
...@@ -2745,7 +2753,7 @@ interpret@^1.0.0: ...@@ -2745,7 +2753,7 @@ interpret@^1.0.0:
version "1.0.3" version "1.0.3"
resolved "http://registry.npm.taobao.org/interpret/download/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90" resolved "http://registry.npm.taobao.org/interpret/download/interpret-1.0.3.tgz#cbc35c62eeee73f19ab7b10a801511401afc0f90"
invariant@^2.1.0, invariant@^2.2.0, invariant@^2.2.1, invariant@^2.2.2: invariant@^2.0.0, invariant@^2.1.0, invariant@^2.2.0, invariant@^2.2.1, invariant@^2.2.2:
version "2.2.2" version "2.2.2"
resolved "http://registry.npm.taobao.org/invariant/download/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" resolved "http://registry.npm.taobao.org/invariant/download/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360"
dependencies: dependencies:
...@@ -3102,6 +3110,10 @@ loader-utils@^1.0.1, loader-utils@^1.0.2: ...@@ -3102,6 +3110,10 @@ loader-utils@^1.0.1, loader-utils@^1.0.2:
emojis-list "^2.0.0" emojis-list "^2.0.0"
json5 "^0.5.0" json5 "^0.5.0"
lodash-es@^4.2.0, lodash-es@^4.2.1:
version "4.17.4"
resolved "http://registry.npm.taobao.org/lodash-es/download/lodash-es-4.17.4.tgz#dcc1d7552e150a0640073ba9cb31d70f032950e7"
lodash.assign@^4.2.0: lodash.assign@^4.2.0:
version "4.2.0" version "4.2.0"
resolved "http://registry.npm.taobao.org/lodash.assign/download/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" resolved "http://registry.npm.taobao.org/lodash.assign/download/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7"
...@@ -3130,7 +3142,7 @@ lodash.uniq@^4.5.0: ...@@ -3130,7 +3142,7 @@ lodash.uniq@^4.5.0:
version "4.5.0" version "4.5.0"
resolved "http://registry.npm.taobao.org/lodash.uniq/download/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" resolved "http://registry.npm.taobao.org/lodash.uniq/download/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773"
lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.2.0, lodash@^4.3.0: lodash@^4.0.0, lodash@^4.14.0, lodash@^4.15.0, lodash@^4.17.2, lodash@^4.17.3, lodash@^4.2.0, lodash@^4.2.1, lodash@^4.3.0:
version "4.17.4" version "4.17.4"
resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" resolved "http://registry.npm.taobao.org/lodash/download/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"
...@@ -3496,7 +3508,7 @@ object-assign@4.1.0: ...@@ -3496,7 +3508,7 @@ object-assign@4.1.0:
version "4.1.0" version "4.1.0"
resolved "http://registry.npm.taobao.org/object-assign/download/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0" resolved "http://registry.npm.taobao.org/object-assign/download/object-assign-4.1.0.tgz#7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0"
object-assign@^4.0.1, object-assign@^4.1.0: object-assign@^4.0.1, object-assign@^4.1.0, object-assign@^4.1.1:
version "4.1.1" version "4.1.1"
resolved "http://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" resolved "http://registry.npm.taobao.org/object-assign/download/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
...@@ -4031,7 +4043,7 @@ promise@^7.1.1: ...@@ -4031,7 +4043,7 @@ promise@^7.1.1:
dependencies: dependencies:
asap "~2.0.3" asap "~2.0.3"
prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@~15.5.7: prop-types@^15.5.10, prop-types@^15.5.4, prop-types@^15.5.6, prop-types@^15.5.7, prop-types@^15.5.8, prop-types@~15.5.7:
version "15.5.10" version "15.5.10"
resolved "http://registry.npm.taobao.org/prop-types/download/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154" resolved "http://registry.npm.taobao.org/prop-types/download/prop-types-15.5.10.tgz#2797dfc3126182e3a95e3dfbb2e893ddd7456154"
dependencies: dependencies:
...@@ -4188,6 +4200,18 @@ react-prop-types@^0.4.0: ...@@ -4188,6 +4200,18 @@ react-prop-types@^0.4.0:
dependencies: dependencies:
warning "^3.0.0" warning "^3.0.0"
react-redux@^5.0.5:
version "5.0.5"
resolved "http://registry.npm.taobao.org/react-redux/download/react-redux-5.0.5.tgz#f8e8c7b239422576e52d6b7db06439469be9846a"
dependencies:
create-react-class "^15.5.3"
hoist-non-react-statics "^1.0.3"
invariant "^2.0.0"
lodash "^4.2.0"
lodash-es "^4.2.0"
loose-envify "^1.1.0"
prop-types "^15.5.10"
react-router-dom@^4.1.1: react-router-dom@^4.1.1:
version "4.1.1" version "4.1.1"
resolved "http://registry.npm.taobao.org/react-router-dom/download/react-router-dom-4.1.1.tgz#3021ade1f2c160af97cf94e25594c5f294583025" resolved "http://registry.npm.taobao.org/react-router-dom/download/react-router-dom-4.1.1.tgz#3021ade1f2c160af97cf94e25594c5f294583025"
...@@ -4307,6 +4331,15 @@ reduce-function-call@^1.0.1: ...@@ -4307,6 +4331,15 @@ reduce-function-call@^1.0.1:
dependencies: dependencies:
balanced-match "^0.4.2" balanced-match "^0.4.2"
redux@^3.6.0:
version "3.6.0"
resolved "http://registry.npm.taobao.org/redux/download/redux-3.6.0.tgz#887c2b3d0b9bd86eca2be70571c27654c19e188d"
dependencies:
lodash "^4.2.1"
lodash-es "^4.2.1"
loose-envify "^1.1.0"
symbol-observable "^1.0.2"
regenerate@^1.2.1: regenerate@^1.2.1:
version "1.3.2" version "1.3.2"
resolved "http://registry.npm.taobao.org/regenerate/download/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260" resolved "http://registry.npm.taobao.org/regenerate/download/regenerate-1.3.2.tgz#d1941c67bad437e1be76433add5b385f95b19260"
...@@ -4893,6 +4926,10 @@ svgo@^0.7.0: ...@@ -4893,6 +4926,10 @@ svgo@^0.7.0:
sax "~1.2.1" sax "~1.2.1"
whet.extend "~0.9.9" whet.extend "~0.9.9"
symbol-observable@^1.0.2:
version "1.0.4"
resolved "http://registry.npm.taobao.org/symbol-observable/download/symbol-observable-1.0.4.tgz#29bf615d4aa7121bdd898b22d4b3f9bc4e2aa03d"
table@^3.7.8: table@^3.7.8:
version "3.8.3" version "3.8.3"
resolved "http://registry.npm.taobao.org/table/download/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f" resolved "http://registry.npm.taobao.org/table/download/table-3.8.3.tgz#2bbc542f0fda9861a755d3947fefd8b3f513855f"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!