Skip to content

Commit

Permalink
add fetch, so we can use import fetch from 'dva/fetch'
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Jun 26, 2016
1 parent 5c196e9 commit 4fa38f6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/popular-products/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import './index.html';
import React from 'react';
import fetch from 'isomorphic-fetch';
import dva, { connect } from 'dva';
import { put, call } from 'dva/effects';
import { Route } from 'dva/router';
import fetch from 'dva/fetch';
import ProductList from './components/ProductList/ProductList';
import styles from './index.less';

Expand Down
1 change: 0 additions & 1 deletion examples/popular-products/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
"dependencies": {
"antd": "^1.6.1",
"dva": "^0.0.1",
"isomorphic-fetch": "^2.2.1",
"react": "^15.1.0",
"react-dom": "^15.1.0"
},
Expand Down
1 change: 1 addition & 0 deletions fetch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('isomorphic-fetch');
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"lint": "eslint --ext .js src"
},
"dependencies": {
"isomorphic-fetch": "^2.2.1",
"react-redux": "4.4.x",
"react-router": "^2.5.1",
"react-router-redux": "^4.0.5",
Expand Down Expand Up @@ -54,6 +55,9 @@
],
"files": [
"lib",
"src"
"src",
"effects.js",
"router.js",
"fetch.js"
]
}
}
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware, compose, combineReducers } from 'redux';
import createSagaMiddleware, { takeEvery, takeLatest } from 'redux-saga';
import { hashHistory, Router, Route, IndexRoute, Link } from 'react-router';
import { hashHistory, Router } from 'react-router';
import { syncHistoryWithStore, routerReducer as routing } from 'react-router-redux';
import { handleActions } from 'redux-actions';
import { fork } from 'redux-saga/effects';
Expand Down

0 comments on commit 4fa38f6

Please sign in to comment.