chore: commit lint fixes for the api

This commit is contained in:
Bouncey
2019-02-06 14:19:58 +00:00
committed by mrugesh mohapatra
parent 010fa63e76
commit 07266b7e43
17 changed files with 159 additions and 154 deletions

View File

@ -33,35 +33,35 @@ class NewsFeed {
const currentFeed = this.state.combinedFeed.slice(0);
log('grabbing feeds');
return Promise.all([
getMediumFeed(),
getLybsynFeed()
]).then(
([mediumFeed, lybsynFeed]) => this.setState(
state => ({
...state,
mediumFeed,
lybsynFeed
getMediumFeed(),
getLybsynFeed()
]).then(
([mediumFeed, lybsynFeed]) => this.setState(
state => ({
...state,
mediumFeed,
lybsynFeed
})
))
.then(() => {
log('crossing the streams');
const { mediumFeed, lybsynFeed} = this.state;
const combinedFeed = [ ...mediumFeed, ...lybsynFeed ].sort((a, b) => {
return compareDesc(a.isoDate, b.isoDate);
});
this.setState(state => ({
...state,
combinedFeed,
readyState: true
}));
})
))
.then(() => {
log('crossing the streams');
const { mediumFeed, lybsynFeed} = this.state;
const combinedFeed = [ ...mediumFeed, ...lybsynFeed ].sort((a, b) => {
return compareDesc(a.isoDate, b.isoDate);
.catch(err => {
console.log(err);
this.setState(state => ({
...state,
combinedFeed: currentFeed
}));
});
this.setState(state => ({
...state,
combinedFeed,
readyState: true
}));
})
.catch(err => {
console.log(err);
this.setState(state => ({
...state,
combinedFeed: currentFeed
}));
});
}

View File

@ -31,12 +31,12 @@ export function getLybsynFeed() {
])
)
/* eslint-disable camelcase */
.map(({ full_item_url, item_title, release_date, item_body_short}) => ({
title: item_title,
extract: item_body_short,
isoDate: new Date(release_date).toISOString(),
link: full_item_url
}));
.map(({ full_item_url, item_title, release_date, item_body_short}) => ({
title: item_title,
extract: item_body_short,
isoDate: new Date(release_date).toISOString(),
link: full_item_url
}));
/* eslint-enable camelcase */
return resolve(items);
});

View File

@ -11,7 +11,7 @@ function getExtract(str) {
function addResponsiveClass(str) {
return str.replace(/\<img/g, '<img class="img-responsive"');
return str.replace(/<img/g, '<img class="img-responsive"');
}
export function getMediumFeed() {