chore: generate

This commit is contained in:
opencode-agent[bot]
2026-03-26 17:08:33 +00:00
parent 28f5176ffd
commit 9f94bdb496
2 changed files with 7 additions and 15 deletions

View File

@@ -127,10 +127,10 @@ Use `Effect.cached` when multiple concurrent callers should share a single in-fl
```ts
// Inside the layer — yield* to initialize the memo
let cached = yield* Effect.cached(loadExpensive())
let cached = yield * Effect.cached(loadExpensive())
const get = Effect.fn("Foo.get")(function* () {
return yield* cached // concurrent callers share the same fiber
return yield* cached // concurrent callers share the same fiber
})
// To invalidate: swap in a fresh memo
@@ -140,6 +140,7 @@ const invalidate = Effect.fn("Foo.invalidate")(function* () {
```
Prefer `Effect.cached` over these patterns:
- Storing a `Fiber.Fiber | undefined` with manual check-and-fork (e.g. `file/index.ts` `ensure`)
- Storing a `Promise<void>` task for deduplication (e.g. `skill/index.ts` `ensure`)
- `let cached: X | undefined` with check-and-load (races when two callers see `undefined` before either resolves)