Skip to content

Instantly share code, notes, and snippets.

@dmoss18
dmoss18 / Baby.js
Last active August 30, 2022 18:25
The baby periodically gets hungry or sleepy. The babysitter needs to be notified whenever the baby's state changes so he/she can help the baby. Add functionality to notify the babysitter. Please also support replacing a babysitter.
const States = {
Default: 0,
Hungry: 1,
Sleepy: 2
}
class Baby {
currentState = States.Default
feedInterval = 0
sleepInterval = 0
class TastytradeContext {
public tastytradeApi: TastytradeApi
public customer: Customer | null = null
public account: Account | null = null
public accountBalance: AccountBalance | null = null
constructor(baseUrl: string) {
this.tastytradeApi = new TastytradeApi(baseUrl)
}
}