I have some atoms that I would like to sync with local storage, but their initial value is effectful. I'm looking for a way to persist the value, but Atom.kvs requires a non-effectful default.
const runtime = Atom.runtime(BrowserKeyValueStore.layerLocalStorage)
const flagAtom = Atom.kvs({
runtime: runtime,
key: "flag",
schema: Schema.Boolean,
defaultValue: () => Effect.succed(false),
})