0.1.0 #1

Merged
Thilawyn merged 81 commits from next into master 2025-07-17 21:17:57 +02:00
Showing only changes of commit c53139d242 - Show all commits

View File

@@ -61,7 +61,7 @@ export const useFC: {
<E, R, P extends {}>( <E, R, P extends {}>(
self: ReactComponent<E, R, P> self: ReactComponent<E, R, P>
): Effect.Effect<React.FC<P>, never, Exclude<R, Scope.Scope>> ): Effect.Effect<React.FC<P>, never, Exclude<R, Scope.Scope>>
} = Effect.fnUntraced(function* <E, R, P extends {}>( } = Effect.fn("useFC")(function* <E, R, P extends {}>(
self: ReactComponent<E, R, P> self: ReactComponent<E, R, P>
) { ) {
const runtimeRef = React.useRef<Runtime.Runtime<Exclude<R, Scope.Scope>>>(null!) const runtimeRef = React.useRef<Runtime.Runtime<Exclude<R, Scope.Scope>>>(null!)
@@ -131,7 +131,7 @@ export const use: {
self: ReactComponent<E, R, P>, self: ReactComponent<E, R, P>,
fn: (Component: React.FC<P>) => React.ReactNode, fn: (Component: React.FC<P>) => React.ReactNode,
): Effect.Effect<React.ReactNode, never, Exclude<R, Scope.Scope>> ): Effect.Effect<React.ReactNode, never, Exclude<R, Scope.Scope>>
} = Effect.fnUntraced(function*(self, fn) { } = Effect.fn("use")(function*(self, fn) {
return fn(yield* useFC(self)) return fn(yield* useFC(self))
}) })