Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export function* loadData() {
- console.log("Saga: Loading Data...");
- try {
- const response = yield call(request, requestURL,
- { method: 'GET', credentials: 'include', headers: {
- 'Content-Type': 'application/json', } });
- // Nothing past this point is ever touched :(
- if (response.success) {
- console.log("SUCCESS!!!!");
- ...
- export default function request(url, options) {
- return fetch(url, options)
- .then(checkStatus)
- .then(parseJSON);
- }
- function parseJSON(response) {
- if (response.status === 204 || response.status === 205) {
- return null;
- }
- var responseClone = response.clone();
- console.log(responseClone.json());
- return response.json();
- }
- SAGA: Loading Data...
- [[PromiseStatus]]:"resolved"
- [[PromiseValue]]:Object
Add Comment
Please, Sign In to add comment