type Store = { color?: string }
const storage = new AsyncLocalStorage<Store>()
const RenderContextResource = Effect.acquireUseRelease(
Effect.succeed({} as Store),
(store) => {
storage.run(store, () => {
// run the effect that "used" this resource here somehow...
})
},
(ctx) => {
// ?
},
)
type Store = { color?: string }
const storage = new AsyncLocalStorage<Store>()
const RenderContextResource = Effect.acquireUseRelease(
Effect.succeed({} as Store),
(store) => {
storage.run(store, () => {
// run the effect that "used" this resource here somehow...
})
},
(ctx) => {
// ?
},
)