Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
return operators were removed (#2)
Browse files Browse the repository at this point in the history
The arrow-function already returns the body
  • Loading branch information
Ihor Gevorkyan authored and criticalbh committed Jan 6, 2018
1 parent 7f1b605 commit 7fa0601
Showing 1 changed file with 16 additions and 18 deletions.
34 changes: 16 additions & 18 deletions app/components/comments-container.comp.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ export class CommentsContainerComponent extends HTMLElement {

connectedCallback() {
this.slug = this.getAttribute('slug');
fetch('https://conduit.productionready.io/api/articles/' + this.slug + '/comments').then((response) => {
return response.json();
}).then(r => {
this.comments = r.comments;
this.innerHTML = this.render();
});
fetch('https://conduit.productionready.io/api/articles/' + this.slug + '/comments')
.then(response => response.json())
.then(r => {
this.comments = r.comments;
this.innerHTML = this.render();
});
}

disconnectedCallback() {
Expand All @@ -32,18 +32,16 @@ export class CommentsContainerComponent extends HTMLElement {

render() {
return `
${this.comments.map(comment => {
return `
<comment-preview
username="${comment.author.username}"
content="${comment.body}"
image="${comment.author.image}"
created-at="${comment.createdAt}"
>
</comment-preview>
`;
}).join(' ')}
${this.comments.map(comment => `
<comment-preview
username="${comment.author.username}"
content="${comment.body}"
image="${comment.author.image}"
created-at="${comment.createdAt}"
>
</comment-preview>
`
}).join(' ')}
`;
}
}

0 comments on commit 7fa0601

Please sign in to comment.