File tree Expand file tree Collapse file tree 4 files changed +37
-4
lines changed
Expand file tree Collapse file tree 4 files changed +37
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,9 @@ import Hello from './Hello';
33import World from './World' ;
44
55export default class App extends React . Component {
6+
67 render ( ) {
8+ const { dispatch, getState} = this . props . store ;
79 return (
810 < div >
911 < Hello />
Original file line number Diff line number Diff line change 1- import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
3- import App from './components/App' ;
1+ import React from 'react'
2+ import { render } from 'react-dom'
3+ import { Provider } from 'react-redux'
4+ import { createStore , applyMiddleware , compose } from 'redux'
5+ import rootReducer from './reducers/rootReducer'
6+ import App from './components/App'
47
5- ReactDOM . render ( < App /> , document . getElementById ( 'container' ) ) ;
8+ const initialState = {
9+ zipCode : { } ,
10+ legislators : [ ]
11+ } ;
12+
13+ const store = createStore ( rootReducer , { state : initialState } , compose (
14+ window . devToolsExtension ? window . devToolsExtension ( ) : f => f
15+ ) ) ;
16+
17+ render (
18+ < App
19+ store = { store }
20+ /> ,
21+ document . getElementById ( 'container' )
22+ ) ;
23+
24+ store . subscribe ( render ) ;
Original file line number Diff line number Diff line change 1+ export default function ( state = { foo : 'bar' } , action ) {
2+ switch ( action . type ) {
3+ case "FOO" : {
4+ return { init : true }
5+ }
6+ default : return state
7+ }
8+
9+ }
Original file line number Diff line number Diff line change 1616 "express" : " ^4.14.0" ,
1717 "react" : " ^15.3.1" ,
1818 "react-dom" : " ^15.3.1" ,
19+ "react-redux" : " ^4.4.6" ,
20+ "redux" : " ^3.6.0" ,
1921 "request" : " ^2.78.0" ,
2022 "request-promise" : " ^4.1.1" ,
2123 "winston" : " ^2.3.0"
4547 "nodemon" : " ^1.10.2" ,
4648 "npm" : " ^3.10.9" ,
4749 "react-addons-test-utils" : " ^15.3.1" ,
50+ "redux-devtools" : " ^3.3.1" ,
4851 "run-sequence" : " ^1.2.2" ,
4952 "supertest" : " ^2.0.1" ,
5053 "webpack" : " ^1.13.2" ,
You can’t perform that action at this time.
0 commit comments