This file contains hidden or 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
class Client extends Person { | |
setName(name) { | |
this.name = name | |
} | |
} | |
const dic = new DIC() | |
dic.register('frogOwner', Client) | |
dic.register('frogOwnerLicense', sallysLicense) | |
dic.register('frog', mikeTheToad) |
This file contains hidden or 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 parseFunction from 'parse-function' | |
const app = parseFunction({ | |
ecmaVersion: 2017, | |
}) | |
class DIC { | |
constructor() { | |
this.dependencies = {} | |
this.factories = {} |
This file contains hidden or 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
class Client extends Person { | |
setName(name) { | |
this.name = name | |
} | |
} |
This file contains hidden or 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
class FrogParadiseOwner { | |
constructor(frogOwner, frogOwnerLicense, frog) { | |
this.id = createId() | |
this.owner = frogOwner | |
this.license = frogOwnerLicense | |
this.frog = frog | |
} | |
createDocument() { | |
return JSON.stringify(this, null, 2) |
This file contains hidden or 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
{ | |
"t_k8pgj8gh_k4ofadkj2x4yluemfgvmm": { | |
"owner": { | |
"firstName": "sally", | |
"lastName": "tran", | |
"id": "t_k8pgj8gh_k4ofadkj2x4yluemfgvmm" | |
}, | |
"frog": { | |
"name": "mike", | |
"gender": "male", |
This file contains hidden or 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
const facilityTitle = 'Frog Paradise' | |
const facilityDescription = | |
'Your new one-stop location for fresh frogs from the sea! ' + | |
'Our frogs are housed with great care from the best professionals all over the world. ' + | |
'Our frogs make great companionship from a wide variety of age groups, from toddlers to ' + | |
'senior adults! What are you waiting for? ' + | |
'Buy a frog today and begin an unforgettable adventure with a companion you dreamed for!' | |
const facilityLocation = { |
This file contains hidden or 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
class Frog { | |
constructor({ name, gender, weight }) { | |
this.name = name | |
this.gender = gender | |
this.weight = weight | |
} | |
jump() { | |
console.log('jumped') | |
} |
This file contains hidden or 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
const mikeTheToad = new Toad( | |
'land', | |
new Frog({ | |
name: 'mike', | |
gender: 'male', | |
weight: 12.5, | |
}), | |
) |
This file contains hidden or 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
class Frog { | |
constructor({ name, gender, weight }) { | |
this.name = name | |
this.gender = gender | |
this.weight = weight | |
} | |
jump() { | |
console.log('jumped') | |
} |
This file contains hidden or 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
class Toad { | |
constructor(habitat, name, gender, weight) { | |
this.habitat = habitat | |
this.frog = new Frog(name, gender, weight) | |
} | |
} |