We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 94efe05 commit b6a6e59Copy full SHA for b6a6e59
src/api/story.js
@@ -0,0 +1,9 @@
1
+const HN_BASE_URL = 'http://hn.algolia.com/api/v1/search?query=';
2
+
3
+const fetchStories = query =>
4
+ fetch(HN_BASE_URL + query)
5
+ .then(response => response.json());
6
7
+export {
8
+ fetchStories,
9
+};
src/sagas/story.js
@@ -1,11 +1,6 @@
import { call, put } from 'redux-saga/effects';
import { doAddStories } from '../actions/story';
-
-const HN_BASE_URL = 'http://hn.algolia.com/api/v1/search?query=';
-const fetchStories = query =>
- fetch(HN_BASE_URL + query)
- .then(response => response.json());
+import { fetchStories } from '../api/story';
10
function* handleFetchStories(action) {
11
const { query } = action;
0 commit comments