capi
capi copied to clipboard
key page pagination happy path
How might we approach simplifying iterating over key pages / pagination? Ideally, one wouldn't need manually track the offset. What's the ideal DX? Maybe...
const count = 100
const p = paginator(System.Account, count)
p.next() // `Promise<[Uint8Array][]>`
for await (const keyPage of p) {
keyPage // [Uint8Array][]
}
In this case, p
stores state about the current offset (outside of the effect system).