Ah, the joys of having a built-in native JavaScript database¹ that can persist and load typed JavaScript objects² and an interactive JavaScript shell (REPL)³ in Kitten⁴ :)
💕
¹ kitten.small-web.org/reference…
² kitten.small-web.org/tutorials…
³ kitten.small-web.org/reference…
⁴ kitten.small-web.org
This entry was edited (1 day ago)

Lubna 🍁
in reply to Aral Balkan • • •I hope you are doing well,
Please support my pinned post 🙏🏼🙏🏼
Fabio Manganiello
in reply to Aral Balkan • • •GitHub - electric-sql/pglite: Embeddable Postgres with real-time, reactive bindings.
GitHubAral Balkan
in reply to Fabio Manganiello • • •@fabio Nope.
Can it do:
export class Day extends CalendarUnit {
/** @type {Array<Slot>} */
slots = this.slots || new Array()
numberOfSlots = this.numberOfSlots || 4
slotDuration = this.slotDuration || 15 // minutes
persistedDate = this.persistedDate || Temporal.Now.zonedDateTimeISO().toJSON()
persistedStartTime = this.persistedStartTime || this.date.withPlainTime('13').toJSON()
// Automatic daily message flags.
sentMorningOfReminder = this.sentMorningOfReminder || false
sentDayBeforeReminder = this.sentDayBeforeReminder || false
sentWelcomeMessage = this.sentWelcomeMessage || false
initialise () {
this.slots ??=
[] this.numberOfSlots ??= 4
this.slotDuration ??= 15
if (this.slots.length === 0) {
for (let i = 0; i < this.numberOfSlots; i++) {
const slot = new Slot()
slot.dayId = this.id
this.addSlot(slot)
}
}
}
get date () {
return Temporal.ZonedDateTime.from(this.persistedDate)
}
set date (date) {
this.persistedDate = date.toJSON() || Temporal.Now.zonedDateTimeISO().toJSON()
}
…
}
kitten.db.calendar.addDay(new Day())
// ;)