react-redux-fetch
Version:
A declarative and customizable way to fetch data for React components and manage that data in the Redux state
30 lines (24 loc) • 553 B
JavaScript
exports.__esModule = true;
exports.default = function (response) {
if (!response) {
return {};
}
var responseObj = {
headers: {},
status: response.status,
statusText: response.statusText,
ok: response.ok
};
if (response.headers.entries) {
var gen = response.headers.entries();
var header = null;
do {
header = gen.next();
if (header.value) {
responseObj.headers[header.value[0]] = header.value[1];
}
} while (header.done === false);
}
return responseObj;
};
;