@typed/navigation 0.10.3 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/Navigation.ts CHANGED
@@ -22,58 +22,58 @@ export interface Navigation {
22
22
 
23
23
  readonly base: string
24
24
 
25
- readonly currentEntry: RefSubject.Computed<never, never, Destination>
25
+ readonly currentEntry: RefSubject.Computed<Destination>
26
26
 
27
- readonly entries: RefSubject.Computed<never, never, ReadonlyArray<Destination>>
27
+ readonly entries: RefSubject.Computed<ReadonlyArray<Destination>>
28
28
 
29
- readonly transition: RefSubject.Computed<never, never, Option.Option<Transition>>
29
+ readonly transition: RefSubject.Computed<Option.Option<Transition>>
30
30
 
31
- readonly canGoBack: RefSubject.Computed<never, never, boolean>
31
+ readonly canGoBack: RefSubject.Computed<boolean>
32
32
 
33
- readonly canGoForward: RefSubject.Computed<never, never, boolean>
33
+ readonly canGoForward: RefSubject.Computed<boolean>
34
34
 
35
35
  readonly navigate: (
36
36
  url: string | URL,
37
37
  options?: NavigateOptions
38
- ) => Effect.Effect<never, NavigationError, Destination>
38
+ ) => Effect.Effect<Destination, NavigationError>
39
39
 
40
- readonly back: (options?: { readonly info?: unknown }) => Effect.Effect<never, NavigationError, Destination>
40
+ readonly back: (options?: { readonly info?: unknown }) => Effect.Effect<Destination, NavigationError>
41
41
 
42
- readonly forward: (options?: { readonly info?: unknown }) => Effect.Effect<never, NavigationError, Destination>
42
+ readonly forward: (options?: { readonly info?: unknown }) => Effect.Effect<Destination, NavigationError>
43
43
 
44
44
  readonly traverseTo: (
45
45
  key: Destination["key"],
46
46
  options?: { readonly info?: unknown }
47
- ) => Effect.Effect<never, NavigationError, Destination>
47
+ ) => Effect.Effect<Destination, NavigationError>
48
48
 
49
49
  readonly updateCurrentEntry: (
50
50
  options: { readonly state: unknown }
51
- ) => Effect.Effect<never, NavigationError, Destination>
51
+ ) => Effect.Effect<Destination, NavigationError>
52
52
 
53
53
  readonly reload: (
54
54
  options?: { readonly info?: unknown; readonly state?: unknown }
55
- ) => Effect.Effect<never, NavigationError, Destination>
55
+ ) => Effect.Effect<Destination, NavigationError>
56
56
 
57
57
  readonly beforeNavigation: <R = never, R2 = never>(
58
58
  handler: BeforeNavigationHandler<R, R2>
59
- ) => Effect.Effect<R | R2 | Scope.Scope, never, void>
59
+ ) => Effect.Effect<void, never, R | R2 | Scope.Scope>
60
60
 
61
61
  readonly onNavigation: <R = never, R2 = never>(
62
62
  handler: NavigationHandler<R, R2>
63
- ) => Effect.Effect<R | R2 | Scope.Scope, never, void>
63
+ ) => Effect.Effect<void, never, R | R2 | Scope.Scope>
64
64
 
65
65
  readonly submit: (
66
66
  data: FormData,
67
67
  formInput?: Simplify<Omit<FormInputFrom, "data">>
68
68
  ) => Effect.Effect<
69
- HttpClient.client.Client.Default,
69
+ Option.Option<HttpClient.response.ClientResponse>,
70
70
  NavigationError | HttpClient.error.HttpClientError,
71
- Option.Option<HttpClient.response.ClientResponse>
71
+ Scope.Scope | HttpClient.client.Client.Default
72
72
  >
73
73
 
74
74
  readonly onFormData: <R = never, R2 = never>(
75
75
  handler: FormDataHandler<R, R2>
76
- ) => Effect.Effect<R | R2 | Scope.Scope, never, void>
76
+ ) => Effect.Effect<void, never, R | R2 | Scope.Scope>
77
77
  }
78
78
 
79
79
  /**
@@ -203,11 +203,11 @@ export interface NavigationEvent extends Schema.Schema.To<typeof NavigationEvent
203
203
  export type BeforeNavigationHandler<R, R2> = (
204
204
  event: BeforeNavigationEvent
205
205
  ) => Effect.Effect<
206
- R,
207
- RedirectError | CancelNavigation,
208
206
  Option.Option<
209
- Effect.Effect<R2, RedirectError | CancelNavigation, unknown>
210
- >
207
+ Effect.Effect<unknown, RedirectError | CancelNavigation, R2>
208
+ >,
209
+ RedirectError | CancelNavigation,
210
+ R
211
211
  >
212
212
 
213
213
  /**
@@ -216,11 +216,11 @@ export type BeforeNavigationHandler<R, R2> = (
216
216
  export type NavigationHandler<R, R2> = (
217
217
  event: NavigationEvent
218
218
  ) => Effect.Effect<
219
- R,
220
- never,
221
219
  Option.Option<
222
- Effect.Effect<R2, never, unknown>
223
- >
220
+ Effect.Effect<unknown, never, R2>
221
+ >,
222
+ never,
223
+ R
224
224
  >
225
225
 
226
226
  /**
@@ -229,11 +229,11 @@ export type NavigationHandler<R, R2> = (
229
229
  export type FormDataHandler<R, R2> = (
230
230
  event: FormDataEvent
231
231
  ) => Effect.Effect<
232
- R,
233
- RedirectError | CancelNavigation,
234
232
  Option.Option<
235
- Effect.Effect<R2, RedirectError | CancelNavigation, Option.Option<HttpClient.response.ClientResponse>>
236
- >
233
+ Effect.Effect<Option.Option<HttpClient.response.ClientResponse>, RedirectError | CancelNavigation, R2>
234
+ >,
235
+ RedirectError | CancelNavigation,
236
+ R
237
237
  >
238
238
 
239
239
  /**
@@ -400,12 +400,12 @@ export function isCancelNavigation(e: unknown): e is CancelNavigation {
400
400
  export const navigate = (
401
401
  url: string | URL,
402
402
  options?: NavigateOptions
403
- ): Effect.Effect<Navigation, NavigationError, Destination> => Navigation.withEffect((n) => n.navigate(url, options))
403
+ ): Effect.Effect<Destination, NavigationError, Navigation> => Navigation.withEffect((n) => n.navigate(url, options))
404
404
 
405
405
  /**
406
406
  * @since 1.0.0
407
407
  */
408
- export const back: (options?: { readonly info?: unknown }) => Effect.Effect<Navigation, NavigationError, Destination> =
408
+ export const back: (options?: { readonly info?: unknown }) => Effect.Effect<Destination, NavigationError, Navigation> =
409
409
  (opts) => Navigation.withEffect((n) => n.back(opts))
410
410
 
411
411
  /**
@@ -413,7 +413,7 @@ export const back: (options?: { readonly info?: unknown }) => Effect.Effect<Navi
413
413
  */
414
414
  export const forward: (
415
415
  options?: { readonly info?: unknown }
416
- ) => Effect.Effect<Navigation, NavigationError, Destination> = (
416
+ ) => Effect.Effect<Destination, NavigationError, Navigation> = (
417
417
  opts
418
418
  ) => Navigation.withEffect((n) => n.forward(opts))
419
419
 
@@ -423,7 +423,7 @@ export const forward: (
423
423
  export const traverseTo: (
424
424
  key: Uuid,
425
425
  options?: { readonly info?: unknown }
426
- ) => Effect.Effect<Navigation, NavigationError, Destination> = (key, opts) =>
426
+ ) => Effect.Effect<Destination, NavigationError, Navigation> = (key, opts) =>
427
427
  Navigation.withEffect((n) => n.traverseTo(key, opts))
428
428
 
429
429
  /**
@@ -431,7 +431,7 @@ export const traverseTo: (
431
431
  */
432
432
  export const updateCurrentEntry: (
433
433
  options: { readonly state: unknown }
434
- ) => Effect.Effect<Navigation, NavigationError, Destination> = (opts) =>
434
+ ) => Effect.Effect<Destination, NavigationError, Navigation> = (opts) =>
435
435
  Navigation.withEffect((n) => n.updateCurrentEntry(opts))
436
436
 
437
437
  /**
@@ -439,14 +439,14 @@ export const updateCurrentEntry: (
439
439
  */
440
440
  export const reload: (
441
441
  options?: { readonly info?: unknown; readonly state?: unknown }
442
- ) => Effect.Effect<Navigation, NavigationError, Destination> = (
442
+ ) => Effect.Effect<Destination, NavigationError, Navigation> = (
443
443
  opts
444
444
  ) => Navigation.withEffect((n) => n.reload(opts))
445
445
 
446
446
  /**
447
447
  * @since 1.0.0
448
448
  */
449
- export const CurrentEntry: RefSubject.Computed<Navigation, never, Destination> = RefSubject.computedFromTag(
449
+ export const CurrentEntry: RefSubject.Computed<Destination, never, Navigation> = RefSubject.computedFromTag(
450
450
  Navigation,
451
451
  (nav) => nav.currentEntry
452
452
  )
@@ -461,7 +461,7 @@ export function getCurrentPathFromUrl(location: Pick<URL, "pathname" | "search"
461
461
  /**
462
462
  * @since 1.0.0
463
463
  */
464
- export const CurrentPath: RefSubject.Computed<Navigation, never, string> = RefSubject.map(
464
+ export const CurrentPath: RefSubject.Computed<string, never, Navigation> = RefSubject.map(
465
465
  CurrentEntry,
466
466
  (d) => getCurrentPathFromUrl(d.url)
467
467
  )
@@ -469,7 +469,7 @@ export const CurrentPath: RefSubject.Computed<Navigation, never, string> = RefSu
469
469
  /**
470
470
  * @since 1.0.0
471
471
  */
472
- export const CurrentEntries: RefSubject.Computed<Navigation, never, ReadonlyArray<Destination>> = RefSubject
472
+ export const CurrentEntries: RefSubject.Computed<ReadonlyArray<Destination>, never, Navigation> = RefSubject
473
473
  .computedFromTag(
474
474
  Navigation,
475
475
  (n) => n.entries
@@ -478,7 +478,7 @@ export const CurrentEntries: RefSubject.Computed<Navigation, never, ReadonlyArra
478
478
  /**
479
479
  * @since 1.0.0
480
480
  */
481
- export const CanGoForward: RefSubject.Computed<Navigation, never, boolean> = RefSubject.computedFromTag(
481
+ export const CanGoForward: RefSubject.Computed<boolean, never, Navigation> = RefSubject.computedFromTag(
482
482
  Navigation,
483
483
  (n) => n.canGoForward
484
484
  )
@@ -486,7 +486,7 @@ export const CanGoForward: RefSubject.Computed<Navigation, never, boolean> = Ref
486
486
  /**
487
487
  * @since 1.0.0
488
488
  */
489
- export const CanGoBack: RefSubject.Computed<Navigation, never, boolean> = RefSubject.computedFromTag(
489
+ export const CanGoBack: RefSubject.Computed<boolean, never, Navigation> = RefSubject.computedFromTag(
490
490
  Navigation,
491
491
  (n) => n.canGoBack
492
492
  )
@@ -508,9 +508,9 @@ export function submit(
508
508
  data: FormData,
509
509
  formInput?: Simplify<Omit<FormInputFrom, "data">>
510
510
  ): Effect.Effect<
511
- Navigation | HttpClient.client.Client.Default,
511
+ Option.Option<HttpClient.response.ClientResponse>,
512
512
  NavigationError | HttpClient.error.HttpClientError,
513
- Option.Option<HttpClient.response.ClientResponse>
513
+ Navigation | HttpClient.client.Client.Default | Scope.Scope
514
514
  > {
515
515
  return Navigation.withEffect((n) => n.submit(data, formInput))
516
516
  }
@@ -520,6 +520,6 @@ export function submit(
520
520
  */
521
521
  export function onFormData<R = never, R2 = never>(
522
522
  handler: FormDataHandler<R, R2>
523
- ): Effect.Effect<Navigation | R | R2 | Scope.Scope, never, void> {
523
+ ): Effect.Effect<void, never, Navigation | R | R2 | Scope.Scope> {
524
524
  return Navigation.withEffect((n) => n.onFormData(handler))
525
525
  }
@@ -38,7 +38,7 @@ declare global {
38
38
  }
39
39
  }
40
40
 
41
- export const fromWindow: Layer.Layer<Window, never, Navigation> = Navigation.scoped(
41
+ export const fromWindow: Layer.Layer<Navigation, never, Window> = Navigation.scoped(
42
42
  Window.withEffect((window) => {
43
43
  const getRandomValues = (length: number) => Effect.sync(() => window.crypto.getRandomValues(new Uint8Array(length)))
44
44
  return Effect.gen(function*(_) {
@@ -108,12 +108,8 @@ const getNavigationState = (navigation: NativeNavigation): NavigationState => {
108
108
 
109
109
  function setupWithNavigation(
110
110
  navigation: NativeNavigation,
111
- runPromise: <E, A>(effect: Effect.Effect<Scope.Scope, E, A>) => Promise<A>
112
- ): Effect.Effect<
113
- Scope.Scope | GetRandomValues,
114
- never,
115
- ModelAndIntent
116
- > {
111
+ runPromise: <E, A>(effect: Effect.Effect<A, E, Scope.Scope>) => Promise<A>
112
+ ): Effect.Effect<ModelAndIntent, never, Scope.Scope | GetRandomValues> {
117
113
  return Effect.gen(function*(_) {
118
114
  const state = yield* _(
119
115
  RefSubject.fromEffect(
@@ -150,7 +146,7 @@ function setupWithNavigation(
150
146
  const runHandlers = (native: NativeEvent) =>
151
147
  Effect.gen(function*(_) {
152
148
  const eventHandlers = yield* _(handlers)
153
- const matches: Array<Effect.Effect<never, never, unknown>> = []
149
+ const matches: Array<Effect.Effect<unknown>> = []
154
150
 
155
151
  const event: NavigationEvent = {
156
152
  type: native.navigationType,
@@ -220,11 +216,7 @@ function shouldNotIntercept(navigationEvent: NativeEvent): boolean {
220
216
  function setupWithHistory(
221
217
  window: Window,
222
218
  onEvent: (event: HistoryEvent) => void
223
- ): Effect.Effect<
224
- GetRandomValues | Scope.Scope,
225
- never,
226
- ModelAndIntent
227
- > {
219
+ ): Effect.Effect<ModelAndIntent, never, GetRandomValues | Scope.Scope> {
228
220
  return Effect.gen(function*(_) {
229
221
  const { location } = window
230
222
  const { original: history, unpatch } = patchHistory(window, onEvent)
@@ -411,19 +403,15 @@ function patchHistory(window: Window, onEvent: (event: HistoryEvent) => void) {
411
403
  type ScopedRuntime<R> = {
412
404
  readonly runtime: Runtime.Runtime<R | Scope.Scope>
413
405
  readonly scope: Scope.Scope
414
- readonly run: <E, A>(effect: Effect.Effect<R | Scope.Scope, E, A>) => Fiber.RuntimeFiber<E, A>
415
- readonly runPromise: <E, A>(effect: Effect.Effect<R | Scope.Scope, E, A>) => Promise<A>
406
+ readonly run: <E, A>(effect: Effect.Effect<A, E, R | Scope.Scope>) => Fiber.RuntimeFiber<A, E>
407
+ readonly runPromise: <E, A>(effect: Effect.Effect<A, E, R | Scope.Scope>) => Promise<A>
416
408
  }
417
409
 
418
- function scopedRuntime<R>(): Effect.Effect<
419
- R | Scope.Scope,
420
- never,
421
- ScopedRuntime<R>
422
- > {
410
+ function scopedRuntime<R>(): Effect.Effect<ScopedRuntime<R>, never, R | Scope.Scope> {
423
411
  return Effect.map(Effect.runtime<R | Scope.Scope>(), (runtime) => {
424
412
  const scope = Context.get(runtime.context, Scope.Scope)
425
413
  const runFork = Runtime.runFork(runtime)
426
- const runPromise = <E, A>(effect: Effect.Effect<R | Scope.Scope, E, A>): Promise<A> =>
414
+ const runPromise = <E, A>(effect: Effect.Effect<A, E, R | Scope.Scope>): Promise<A> =>
427
415
  new Promise((resolve, reject) => {
428
416
  const fiber = runFork(effect, { scope })
429
417
  fiber.addObserver(Exit.match({
@@ -18,7 +18,7 @@ import {
18
18
  setupFromModelAndIntent
19
19
  } from "./shared.js"
20
20
 
21
- export const memory = (options: MemoryOptions): Layer.Layer<never, never, Navigation> =>
21
+ export const memory = (options: MemoryOptions): Layer.Layer<Navigation> =>
22
22
  Navigation.scoped(
23
23
  Effect.gen(function*(_) {
24
24
  const getRandomValues = yield* _(GetRandomValues)
@@ -33,7 +33,7 @@ export const memory = (options: MemoryOptions): Layer.Layer<never, never, Naviga
33
33
 
34
34
  export function initialMemory(
35
35
  options: InitialMemoryOptions
36
- ): Layer.Layer<never, never, Navigation> {
36
+ ): Layer.Layer<Navigation> {
37
37
  return Navigation.scoped(
38
38
  Effect.gen(function*(_) {
39
39
  const getRandomValues = yield* _(GetRandomValues)
@@ -56,11 +56,7 @@ export function initialMemory(
56
56
 
57
57
  function setupMemory(
58
58
  options: MemoryOptions
59
- ): Effect.Effect<
60
- GetRandomValues | Scope.Scope,
61
- never,
62
- ModelAndIntent
63
- > {
59
+ ): Effect.Effect<ModelAndIntent, never, GetRandomValues | Scope.Scope> {
64
60
  return Effect.gen(function*(_) {
65
61
  const state = yield* _(
66
62
  RefSubject.fromEffect(
@@ -44,33 +44,15 @@ export const getUrl = (origin: string, urlOrPath: string | URL): URL => {
44
44
  }
45
45
 
46
46
  export type ModelAndIntent = {
47
- readonly state: RefSubject.RefSubject<never, never, NavigationState>
48
- readonly canGoBack: RefSubject.Computed<
49
- never,
50
- never,
51
- boolean
52
- >
53
- readonly canGoForward: RefSubject.Computed<
54
- never,
55
- never,
56
- boolean
57
- >
47
+ readonly state: RefSubject.RefSubject<NavigationState>
48
+ readonly canGoBack: RefSubject.Computed<boolean>
49
+ readonly canGoForward: RefSubject.Computed<boolean>
58
50
  readonly beforeHandlers: RefSubject.RefSubject<
59
- never,
60
- never,
61
51
  Set<readonly [BeforeNavigationHandler<any, any>, Context.Context<any>]>
62
52
  >
63
- readonly handlers: RefSubject.RefSubject<
64
- never,
65
- never,
66
- Set<readonly [NavigationHandler<any, any>, Context.Context<any>]>
67
- >
53
+ readonly handlers: RefSubject.RefSubject<Set<readonly [NavigationHandler<any, any>, Context.Context<any>]>>
68
54
 
69
- readonly formDataHandlers: RefSubject.RefSubject<
70
- never,
71
- never,
72
- Set<readonly [FormDataHandler<any, any>, Context.Context<any>]>
73
- >
55
+ readonly formDataHandlers: RefSubject.RefSubject<Set<readonly [FormDataHandler<any, any>, Context.Context<any>]>>
74
56
 
75
57
  readonly commit: Commit
76
58
  }
@@ -92,7 +74,7 @@ export function setupFromModelAndIntent(
92
74
  const runBeforeHandlers = (event: BeforeNavigationEvent) =>
93
75
  Effect.gen(function*(_) {
94
76
  const handlers = yield* _(beforeHandlers)
95
- const matches: Array<Effect.Effect<never, RedirectError | CancelNavigation, unknown>> = []
77
+ const matches: Array<Effect.Effect<unknown, RedirectError | CancelNavigation>> = []
96
78
 
97
79
  for (const [handler, ctx] of handlers) {
98
80
  const exit = yield* _(handler(event), Effect.provide(ctx), Effect.either)
@@ -121,7 +103,7 @@ export function setupFromModelAndIntent(
121
103
  const runHandlers = (event: NavigationEvent) =>
122
104
  Effect.gen(function*(_) {
123
105
  const eventHandlers = yield* _(handlers)
124
- const matches: Array<Effect.Effect<never, never, unknown>> = []
106
+ const matches: Array<Effect.Effect<unknown>> = []
125
107
 
126
108
  for (const [handler, ctx] of eventHandlers) {
127
109
  const match = yield* _(handler(event), Effect.provide(ctx))
@@ -138,14 +120,14 @@ export function setupFromModelAndIntent(
138
120
  const runFormDataHandlers = (
139
121
  event: FormDataEvent
140
122
  ): Effect.Effect<
141
- HttpClient.client.Client.Default,
123
+ Either.Either<RedirectError | CancelNavigation, Option.Option<HttpClient.response.ClientResponse>>,
142
124
  NavigationError | HttpClient.error.HttpClientError,
143
- Either.Either<RedirectError | CancelNavigation, Option.Option<HttpClient.response.ClientResponse>>
125
+ Scope.Scope | HttpClient.client.Client.Default
144
126
  > =>
145
127
  Effect.gen(function*(_) {
146
128
  const handlers = yield* _(formDataHandlers)
147
129
  const matches: Array<
148
- Effect.Effect<never, RedirectError | CancelNavigation, Option.Option<HttpClient.response.ClientResponse>>
130
+ Effect.Effect<Option.Option<HttpClient.response.ClientResponse>, RedirectError | CancelNavigation>
149
131
  > = []
150
132
 
151
133
  for (const [handler, ctx] of handlers) {
@@ -183,11 +165,11 @@ export function setupFromModelAndIntent(
183
165
 
184
166
  const runNavigationEvent = (
185
167
  beforeEvent: BeforeNavigationEvent,
186
- get: Effect.Effect<never, never, NavigationState>,
187
- set: (a: NavigationState) => Effect.Effect<never, never, NavigationState>,
168
+ get: Effect.Effect<NavigationState>,
169
+ set: (a: NavigationState) => Effect.Effect<NavigationState>,
188
170
  depth: number,
189
171
  skipCommit: boolean = false
190
- ): Effect.Effect<never, NavigationError, Destination> =>
172
+ ): Effect.Effect<Destination, NavigationError> =>
191
173
  Effect.gen(function*(_) {
192
174
  let current = yield* _(get)
193
175
  current = yield* _(set({ ...current, transition: Option.some(beforeEvent) }))
@@ -246,10 +228,10 @@ export function setupFromModelAndIntent(
246
228
 
247
229
  const handleError = (
248
230
  error: RedirectError | CancelNavigation,
249
- get: Effect.Effect<never, never, NavigationState>,
250
- set: (a: NavigationState) => Effect.Effect<never, never, NavigationState>,
231
+ get: Effect.Effect<NavigationState>,
232
+ set: (a: NavigationState) => Effect.Effect<NavigationState>,
251
233
  depth: number
252
- ): Effect.Effect<never, NavigationError, Destination> =>
234
+ ): Effect.Effect<Destination, NavigationError> =>
253
235
  Effect.gen(function*(_) {
254
236
  if (depth >= 25) {
255
237
  return yield* _(Effect.dieMessage(`Redirect loop detected.`))
@@ -355,7 +337,7 @@ export function setupFromModelAndIntent(
355
337
 
356
338
  const beforeNavigation = <R = never, R2 = never>(
357
339
  handler: BeforeNavigationHandler<R, R2>
358
- ): Effect.Effect<R | R2 | Scope.Scope, never, void> =>
340
+ ): Effect.Effect<void, never, R | R2 | Scope.Scope> =>
359
341
  Effect.contextWithEffect((ctx) => {
360
342
  const entry = [handler, ctx] as const
361
343
 
@@ -373,7 +355,7 @@ export function setupFromModelAndIntent(
373
355
 
374
356
  const onNavigation = <R = never, R2 = never>(
375
357
  handler: NavigationHandler<R, R2>
376
- ): Effect.Effect<R | R2 | Scope.Scope, never, void> =>
358
+ ): Effect.Effect<void, never, R | R2 | Scope.Scope> =>
377
359
  Effect.contextWithEffect((ctx) => {
378
360
  const entry = [handler, ctx] as const
379
361
 
@@ -410,9 +392,9 @@ export function setupFromModelAndIntent(
410
392
  data: FormData,
411
393
  input?: Omit<FormInputFrom, "data">
412
394
  ): Effect.Effect<
413
- HttpClient.client.Client.Default,
395
+ Option.Option<HttpClient.response.ClientResponse>,
414
396
  NavigationError | HttpClient.error.HttpClientError,
415
- Option.Option<HttpClient.response.ClientResponse>
397
+ Scope.Scope | HttpClient.client.Client.Default
416
398
  > =>
417
399
  state.runUpdates(({ get, set }) =>
418
400
  Effect.gen(function*(_) {
@@ -457,7 +439,7 @@ export function setupFromModelAndIntent(
457
439
 
458
440
  const onFormData = <R = never, R2 = never>(
459
441
  handler: FormDataHandler<R, R2>
460
- ): Effect.Effect<R | R2 | Scope.Scope, never, void> =>
442
+ ): Effect.Effect<void, never, R | R2 | Scope.Scope> =>
461
443
  Effect.contextWithEffect((ctx) => {
462
444
  const entry = [handler, ctx] as const
463
445