Fix
All checks were successful
Lint / lint (push) Successful in 12s

This commit is contained in:
Julien Valverdé
2025-08-11 14:30:07 +02:00
parent 6d3361f399
commit a94ffeb3db
2 changed files with 87 additions and 84 deletions

View File

@@ -244,81 +244,81 @@ export namespace make {
}
export type NonGen = {
// <Eff extends Effect.Effect<React.ReactNode, any, any>, P extends {} = {}>(
// body: (props: P) => Eff
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
// <Eff extends Effect.Effect<React.ReactNode, any, any>, A, P extends {} = {}>(
// body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
// <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, P extends {} = {}>(
// body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
// <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, P extends {} = {}>(
// body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
// <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, P extends {} = {}>(
// body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
// <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, P extends {} = {}>(
// body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => E,
// e: (_: E, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
// <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, P extends {} = {}>(
// body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => E,
// e: (_: E, props: NoInfer<P>) => F,
// f: (_: F, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
// <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, P extends {} = {}>(
// body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => E,
// e: (_: E, props: NoInfer<P>) => F,
// f: (_: F, props: NoInfer<P>) => G,
// g: (_: G, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
// <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, H, P extends {} = {}>(
// body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => E,
// e: (_: E, props: NoInfer<P>) => F,
// f: (_: F, props: NoInfer<P>) => G,
// g: (_: G, props: NoInfer<P>) => H,
// h: (_: H, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
// <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, H, I, P extends {} = {}>(
// body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => E,
// e: (_: E, props: NoInfer<P>) => F,
// f: (_: F, props: NoInfer<P>) => G,
// g: (_: G, props: NoInfer<P>) => H,
// h: (_: H, props: NoInfer<P>) => I,
// i: (_: I, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
<Eff extends Effect.Effect<React.ReactNode, any, any>, P extends {} = {}>(
body: (props: P) => Eff
): Component<P, Effect.Effect.Success<Effect.Effect.AsEffect<Eff>>, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => Eff,
): Component<P, Effect.Effect.Success<Effect.Effect.AsEffect<Eff>>, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => Eff,
): Component<P, Effect.Effect.Success<Effect.Effect.AsEffect<Eff>>, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => Eff,
): Component<P, Effect.Effect.Success<Effect.Effect.AsEffect<Eff>>, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => Eff,
): Component<P, Effect.Effect.Success<Effect.Effect.AsEffect<Eff>>, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => E,
e: (_: E, props: NoInfer<P>) => Eff,
): Component<P, Effect.Effect.Success<Effect.Effect.AsEffect<Eff>>, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => E,
e: (_: E, props: NoInfer<P>) => F,
f: (_: F, props: NoInfer<P>) => Eff,
): Component<P, Effect.Effect.Success<Effect.Effect.AsEffect<Eff>>, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => E,
e: (_: E, props: NoInfer<P>) => F,
f: (_: F, props: NoInfer<P>) => G,
g: (_: G, props: NoInfer<P>) => Eff,
): Component<P, Effect.Effect.Success<Effect.Effect.AsEffect<Eff>>, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, H, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => E,
e: (_: E, props: NoInfer<P>) => F,
f: (_: F, props: NoInfer<P>) => G,
g: (_: G, props: NoInfer<P>) => H,
h: (_: H, props: NoInfer<P>) => Eff,
): Component<P, Effect.Effect.Success<Effect.Effect.AsEffect<Eff>>, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
<Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, H, I, P extends {} = {}>(
body: (props: P) => A,
a: (_: A, props: NoInfer<P>) => B,
b: (_: B, props: NoInfer<P>) => C,
c: (_: C, props: NoInfer<P>) => D,
d: (_: D, props: NoInfer<P>) => E,
e: (_: E, props: NoInfer<P>) => F,
f: (_: F, props: NoInfer<P>) => G,
g: (_: G, props: NoInfer<P>) => H,
h: (_: H, props: NoInfer<P>) => I,
i: (_: I, props: NoInfer<P>) => Eff,
): Component<P, Effect.Effect.Success<Effect.Effect.AsEffect<Eff>>, Effect.Effect.Error<Eff>, Effect.Effect.Context<Eff>>
}
}

View File

@@ -4,18 +4,21 @@ import { TodosState } from "@/todo/TodosState.service"
import { createFileRoute } from "@tanstack/react-router"
import { Effect } from "effect"
import { Component } from "effect-fc"
import { Hooks } from "effect-fc/hooks"
import { useContext } from "effect-fc/hooks"
const TodosStateLive = TodosState.Default("todos")
export const Route = createFileRoute("/")({
component: Component.makeUntraced(function* Index() {
return yield* Todos.pipe(
Effect.map(FC => <FC />),
Effect.provide(yield* Hooks.useContext(TodosStateLive, { finalizerExecutionMode: "fork" })),
)
}).pipe(
Component.withRuntime(runtime.context)
const Index = Component.makeUntraced(function* Index() {
const context = yield* useContext(TodosStateLive, { finalizerExecutionMode: "fork" })
return yield* Todos.pipe(
Effect.map(F => <F />),
Effect.provide(context),
)
}).pipe(
Component.withRuntime(runtime.context)
)
export const Route = createFileRoute("/")({
component: Index
})