Skip to content

Commit

Permalink
bwc
Browse files Browse the repository at this point in the history
  • Loading branch information
patroza committed Sep 21, 2024
1 parent 204578d commit fb62f02
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/wicked-rabbits-smoke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"effect-app": patch
---

bwc
26 changes: 23 additions & 3 deletions packages/prelude/src/client/router.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { BuildRequest } from "@effect-app/schema/REST"
import { Req as Req_ } from "@effect-app/schema/REST"
import type { C } from "vitest/dist/chunks/environment.C5eAp3K6.js"
import { S } from "../lib.js"

// TODO: get rid of Request in Request
export const makeClientRouter = <RequestConfig extends object>() => {
function Req<M>(): {
<Fields extends S.Struct.Fields, C extends RequestConfig & { success: S.Schema.Any }>(
Expand All @@ -18,7 +20,13 @@ export const makeClientRouter = <RequestConfig extends object>() => {
}
>
& {
Request: M
Request: BuildRequest<
Fields,
"/",
"AUTO",
M,
C
>
}
<Fields extends S.Struct.Fields, C extends RequestConfig>(
fields: Fields,
Expand All @@ -34,7 +42,13 @@ export const makeClientRouter = <RequestConfig extends object>() => {
}
>
& {
Request: M
Request: BuildRequest<
Fields,
"/",
"AUTO",
M,
C
>
}
<Fields extends S.Struct.Fields>(
fields: Fields
Expand All @@ -49,7 +63,13 @@ export const makeClientRouter = <RequestConfig extends object>() => {
}
>
& {
Request: M
Request: BuildRequest<
Fields,
"/",
"AUTO",
M,
C
>
}
} {
return <Fields extends S.Struct.Fields, C extends RequestConfig & { success: S.Schema.Any }>(
Expand Down

0 comments on commit fb62f02

Please sign in to comment.