ckoeninger
05/03/2023, 6:50 PMckoeninger
05/03/2023, 6:52 PMjohn.spurlock
05/03/2023, 6:52 PMDani Foldi
05/03/2023, 6:56 PMckoeninger
05/03/2023, 6:56 PMDani Foldi
05/03/2023, 6:57 PMckoeninger
05/03/2023, 6:58 PMUnsmart | Tech debt
05/03/2023, 7:02 PMDani Foldi
05/03/2023, 7:04 PMdave
05/03/2023, 8:14 PMtypescript
export class Counter extends createDurable({ autoReturn: true }) {
counter: number;
constructor(state: {} | undefined, env: {} | undefined) {
super(state, env)
// anything defined here is only used for initialization (if not loaded from storage)
this.counter = 0
}
// Because this function does not return anything, it will return the entire contents
// Example: { counter: 1 }
increment() {
this.counter++
}
// Any explicit return will honored, despite the autoReturn flag.
// Note that any serializable params can passed through from the Worker without issue.
add(a: number, b: number) {
return a + b
}
}
dave
05/03/2023, 8:26 PMckoeninger
05/03/2023, 10:46 PMUnsmart | Tech debt
05/03/2023, 10:46 PMdave
05/03/2023, 10:58 PMcustomStorageAdapter
for supabase that uses D1 😄dave
05/03/2023, 10:59 PMjohn.spurlock
05/03/2023, 11:06 PMsathoro
05/04/2023, 3:19 AMdave
05/04/2023, 3:19 AMdave
05/04/2023, 3:19 AMsathoro
05/04/2023, 3:24 AMdave
05/04/2023, 3:31 AMckoeninger
05/04/2023, 1:14 PMjohn.spurlock
05/04/2023, 1:21 PMsathoro
05/04/2023, 3:40 PMUnsmart | Tech debt
05/04/2023, 4:50 PMsathoro
05/04/2023, 4:59 PMsathoro
05/04/2023, 4:59 PMDurable Object reset because its code was updated.
Unsmart | Tech debt
05/04/2023, 5:00 PM