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 = { export type NonGen = {
// <Eff extends Effect.Effect<React.ReactNode, any, any>, P extends {} = {}>( <Eff extends Effect.Effect<React.ReactNode, any, any>, P extends {} = {}>(
// body: (props: P) => Eff body: (props: P) => Eff
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<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 {} = {}>( <Eff extends Effect.Effect<React.ReactNode, any, any>, A, P extends {} = {}>(
// body: (props: P) => A, body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => Eff, a: (_: A, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<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 {} = {}>( <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, P extends {} = {}>(
// body: (props: P) => A, body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B, a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => Eff, b: (_: B, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<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 {} = {}>( <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, P extends {} = {}>(
// body: (props: P) => A, body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B, a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C, b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => Eff, c: (_: C, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<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 {} = {}>( <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, P extends {} = {}>(
// body: (props: P) => A, body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B, a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C, b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D, c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => Eff, d: (_: D, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<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 {} = {}>( <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, P extends {} = {}>(
// body: (props: P) => A, body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B, a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C, b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D, c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => E, d: (_: D, props: NoInfer<P>) => E,
// e: (_: E, props: NoInfer<P>) => Eff, e: (_: E, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<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 {} = {}>( <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, P extends {} = {}>(
// body: (props: P) => A, body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B, a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C, b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D, c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => E, d: (_: D, props: NoInfer<P>) => E,
// e: (_: E, props: NoInfer<P>) => F, e: (_: E, props: NoInfer<P>) => F,
// f: (_: F, props: NoInfer<P>) => Eff, f: (_: F, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<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 {} = {}>( <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, P extends {} = {}>(
// body: (props: P) => A, body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B, a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C, b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D, c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => E, d: (_: D, props: NoInfer<P>) => E,
// e: (_: E, props: NoInfer<P>) => F, e: (_: E, props: NoInfer<P>) => F,
// f: (_: F, props: NoInfer<P>) => G, f: (_: F, props: NoInfer<P>) => G,
// g: (_: G, props: NoInfer<P>) => Eff, g: (_: G, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<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 {} = {}>( <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, H, P extends {} = {}>(
// body: (props: P) => A, body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B, a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C, b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D, c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => E, d: (_: D, props: NoInfer<P>) => E,
// e: (_: E, props: NoInfer<P>) => F, e: (_: E, props: NoInfer<P>) => F,
// f: (_: F, props: NoInfer<P>) => G, f: (_: F, props: NoInfer<P>) => G,
// g: (_: G, props: NoInfer<P>) => H, g: (_: G, props: NoInfer<P>) => H,
// h: (_: H, props: NoInfer<P>) => Eff, h: (_: H, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<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 {} = {}>( <Eff extends Effect.Effect<React.ReactNode, any, any>, A, B, C, D, E, F, G, H, I, P extends {} = {}>(
// body: (props: P) => A, body: (props: P) => A,
// a: (_: A, props: NoInfer<P>) => B, a: (_: A, props: NoInfer<P>) => B,
// b: (_: B, props: NoInfer<P>) => C, b: (_: B, props: NoInfer<P>) => C,
// c: (_: C, props: NoInfer<P>) => D, c: (_: C, props: NoInfer<P>) => D,
// d: (_: D, props: NoInfer<P>) => E, d: (_: D, props: NoInfer<P>) => E,
// e: (_: E, props: NoInfer<P>) => F, e: (_: E, props: NoInfer<P>) => F,
// f: (_: F, props: NoInfer<P>) => G, f: (_: F, props: NoInfer<P>) => G,
// g: (_: G, props: NoInfer<P>) => H, g: (_: G, props: NoInfer<P>) => H,
// h: (_: H, props: NoInfer<P>) => I, h: (_: H, props: NoInfer<P>) => I,
// i: (_: I, props: NoInfer<P>) => Eff, i: (_: I, props: NoInfer<P>) => Eff,
// ): Component<P, Effect.Effect.Error<Eff>, Effect.Effect.Context<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 { createFileRoute } from "@tanstack/react-router"
import { Effect } from "effect" import { Effect } from "effect"
import { Component } from "effect-fc" import { Component } from "effect-fc"
import { Hooks } from "effect-fc/hooks" import { useContext } from "effect-fc/hooks"
const TodosStateLive = TodosState.Default("todos") const TodosStateLive = TodosState.Default("todos")
export const Route = createFileRoute("/")({ const Index = Component.makeUntraced(function* Index() {
component: Component.makeUntraced(function* Index() { const context = yield* useContext(TodosStateLive, { finalizerExecutionMode: "fork" })
return yield* Todos.pipe( return yield* Todos.pipe(
Effect.map(FC => <FC />), Effect.map(F => <F />),
Effect.provide(yield* Hooks.useContext(TodosStateLive, { finalizerExecutionMode: "fork" })), Effect.provide(context),
) )
}).pipe( }).pipe(
Component.withRuntime(runtime.context) Component.withRuntime(runtime.context)
) )
export const Route = createFileRoute("/")({
component: Index
}) })