File tree Expand file tree Collapse file tree 5 files changed +149
-10
lines changed Expand file tree Collapse file tree 5 files changed +149
-10
lines changed Original file line number Diff line number Diff line change 22
22
"babel-eslint" : " 7.2.3" ,
23
23
"babel-jest" : " 20.0.3" ,
24
24
"babel-loader" : " 7.1.2" ,
25
+ "babel-polyfill" : " ^6.26.0" ,
25
26
"babel-preset-react-app" : " ^3.1.0" ,
26
27
"babel-runtime" : " 6.26.0" ,
27
28
"case-sensitive-paths-webpack-plugin" : " 2.1.1" ,
51
52
"react-router-prop-types" : " 0.0.2" ,
52
53
"react-router-redux" : " next" ,
53
54
"redux" : " ^3.7.2" ,
55
+ "redux-json-api" : " ^2.0.0-beta.4" ,
54
56
"redux-thunk" : " ^2.2.0" ,
55
57
"sanitize.css" : " ^5.0.0" ,
56
58
"style-loader" : " 0.19.0" ,
Original file line number Diff line number Diff line change @@ -42,10 +42,8 @@ class Home extends React.Component {
42
42
}
43
43
}
44
44
45
- const mapStateToProps = state => ( {
46
- count : state . counter . count ,
47
- isIncrementing : state . counter . isIncrementing ,
48
- isDecrementing : state . counter . isDecrementing
45
+ const mapStateToProps = ( ) => ( {
46
+
49
47
} ) ;
50
48
51
49
const mapDispatchToProps = dispatch => bindActionCreators ( {
Original file line number Diff line number Diff line change @@ -3,13 +3,21 @@ import { render } from 'react-dom';
3
3
import { Provider } from 'react-redux' ;
4
4
import { ConnectedRouter } from 'react-router-redux' ;
5
5
import store , { history } from './store' ;
6
+ import { setAxiosConfig } from 'redux-json-api' ;
6
7
import App from './containers/app' ;
7
8
8
9
import 'sanitize.css/sanitize.css' ;
9
10
import './styles/main.scss' ;
10
11
11
12
const target = document . querySelector ( '#root' ) ;
12
13
14
+ store . dispatch ( setAxiosConfig ( {
15
+ baseURL : 'http://localhost:9500/api' ,
16
+ headers : {
17
+ 'Content-Type' : 'application/json' ,
18
+ } ,
19
+ } ) ) ;
20
+
13
21
render (
14
22
< Provider store = { store } >
15
23
< ConnectedRouter history = { history } >
Original file line number Diff line number Diff line change 1
1
import { combineReducers } from 'redux' ;
2
2
import { routerReducer } from 'react-router-redux' ;
3
- import counter from './counter ' ;
3
+ import { reducer as api } from 'redux-json-api ' ;
4
4
5
5
export default combineReducers ( {
6
6
router : routerReducer ,
7
- counter
7
+ api ,
8
8
} ) ;
You can’t perform that action at this time.
0 commit comments