This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as data from './data.json' | |
async function makeThreadObject(thread) { | |
return { | |
...thread, | |
replies: await getReplies(thread.id), | |
author: await getAuthor(thread.user_id) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"threads": [ | |
{ | |
"id": 101, | |
"title": "Next level stuff!", | |
"text": "I'm baby next level locavore organic chicharrones, celiac gastropub fanny pack mlkshk. Everyday carry keytar tilde, mumblecore selvage vaporware crucifix prism bitters. Knausgaard fashion axe williamsburg chillwave, intelligentsia kogi authentic freegan XOXO plaid mixtape palo santo. Celiac lumbersexual schlitz cray, 8-bit heirloom chicharrones williamsburg portland wolf lomo fam lyft. Coloring book hoodie tilde fingerstache umami offal tote bag whatever intelligentsia stumptown schlitz meditation tbh.", | |
"user_id": 301 | |
}, | |
{ | |
"id": 102, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
users: [ | |
{name: 'Alex', hobbies: ['coding', 'movies', 'techno party', 'boardgames']}, | |
{name: 'Rolf', hobbies: ['golf', 'food', 'dancing']}, | |
{name: 'Maria', hobbies: ['coding', 'swimming', 'boardgames']} | |
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function createRocket () { | |
const engines = 4 | |
const fuelConsumptionPerEngine = 10 | |
return { | |
started: false, | |
fuel: 0, | |
startEngine () { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class User { | |
constructor (details){ | |
const {firstName, lastName} = details | |
this.firstName = firstName | |
this.lastName = lastName | |
} | |
get name () { | |
return `${this.firstName} ${this.lastName}` | |
} | |
get initials() { |