Skip to content

Commit 14aba14

Browse files
committed
fix clientFor
1 parent 4394a2f commit 14aba14

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

.changeset/easy-spiders-study.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"effect-app": patch
3+
---
4+
5+
fix: clientFor

packages/effect-app/src/client/apiClientFactory.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -254,14 +254,14 @@ const makeApiClientFactory = Effect
254254
}
255255

256256
return Effect.fnUntraced(function*<M extends RequestsAny>(models: M) {
257-
const found = cache.get(models)
257+
const found = cache.get(models) as Client<M, ExtractModuleName<M>> | undefined
258258
if (found) {
259259
return found
260260
}
261261
const m = yield* makeClientFor(models, requestLevelLayers, options)
262262
cache.set(models, m.client)
263263
register.push(m.mr)
264-
return m.client
264+
return m.client as Client<M, ExtractModuleName<M>>
265265
})
266266
}
267267

0 commit comments

Comments
 (0)