Closed tjjfvi closed 1 year ago
Should we provide access to scope within the Rune system? (to enable the fluent API and patterns to decide how/when to cache-invalidate)
import { $accountInfo, polkadotDev } from "@capi/polkadot-dev"
import { $, createDevUsers, Scope } from "capi"
const { alexa } = await createDevUsers()
const scope = new Scope()
const accountInfo = polkadotDev.System.Account.value(alexa.publicKey)
const a = await accountInfo.run(scope)
await delay(30000)
const b = await accountInfo.run(scope) // could be different now
await delay(30000)
const c = await accountInfo.run(scope) // could be different yet again
How might one specify whether to rerun all occurrences, vs. idempotent per run, vs. per scope?
For now, these kinds of questions of out of scope (pun intended) until the rest of the caching/memoization system is more settled.
Resolves #978