0.1.3 #4
@@ -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>>
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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() {
|
||||
const Index = Component.makeUntraced(function* Index() {
|
||||
const context = yield* useContext(TodosStateLive, { finalizerExecutionMode: "fork" })
|
||||
return yield* Todos.pipe(
|
||||
Effect.map(FC => <FC />),
|
||||
Effect.provide(yield* Hooks.useContext(TodosStateLive, { finalizerExecutionMode: "fork" })),
|
||||
Effect.map(F => <F />),
|
||||
Effect.provide(context),
|
||||
)
|
||||
}).pipe(
|
||||
Component.withRuntime(runtime.context)
|
||||
)
|
||||
|
||||
export const Route = createFileRoute("/")({
|
||||
component: Index
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user