0.1.0 #1
@@ -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))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user