Skip to content

Instantly share code, notes, and snippets.

View rahaug's full-sized avatar

Rolf Haug rahaug

View GitHub Profile
import * as data from './data.json'
async function makeThreadObject(thread) {
return {
...thread,
replies: await getReplies(thread.id),
author: await getAuthor(thread.user_id)
}
}
@rahaug
rahaug / data.json
Created January 28, 2021 12:06
Forum dummy data
{
"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,
users: [
{name: 'Alex', hobbies: ['coding', 'movies', 'techno party', 'boardgames']},
{name: 'Rolf', hobbies: ['golf', 'food', 'dancing']},
{name: 'Maria', hobbies: ['coding', 'swimming', 'boardgames']}
]
export function createRocket () {
const engines = 4
const fuelConsumptionPerEngine = 10
return {
started: false,
fuel: 0,
startEngine () {
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() {