Refactor
Lint / lint (push) Failing after 1m6s

This commit is contained in:
Julien Valverdé
2026-06-23 03:25:58 +02:00
parent c8df30480a
commit 6b5c501a98
2 changed files with 35 additions and 26 deletions
+5 -5
View File
@@ -1,6 +1,6 @@
/** biome-ignore-all lint/complexity/noBannedTypes: {} is the default type for React props */
/** biome-ignore-all lint/complexity/useArrowFunction: necessary for class prototypes */
import { Context, type Duration, Effect, Equivalence, ExecutionStrategy, Exit, Fiber, Function, HashMap, identity, Layer, Option, Pipeable, Predicate, Ref, Runtime, Scope, Tracer } from "effect"
import { Context, type Duration, Effect, Equivalence, ExecutionStrategy, Exit, Fiber, Function, HashMap, identity, Layer, Option, Pipeable, Predicate, Ref, Scope, Tracer } from "effect"
import * as React from "react"
@@ -609,18 +609,18 @@ export const withOptions: {
*/
export const withRuntime: {
<P extends {}, A extends React.ReactNode, E, R, F extends Component.Signature>(
context: React.Context<Runtime.Runtime<R>>,
context: React.Context<Context.Context<R>>,
): (self: Component<P, A, E, Scope.Scope | NoInfer<R>, F>) => F
<P extends {}, A extends React.ReactNode, E, R, F extends Component.Signature>(
self: Component<P, A, E, Scope.Scope | NoInfer<R>, F>,
context: React.Context<Runtime.Runtime<R>>,
context: React.Context<Context.Context<R>>,
): F
} = Function.dual(2, <P extends {}, A extends React.ReactNode, E, R, F extends Component.Signature>(
self: Component<P, A, E, R, F>,
context: React.Context<Runtime.Runtime<R>>,
context: React.Context<Context.Context<R>>,
) => function WithRuntime(props: P) {
return React.createElement(
Runtime.runSync(React.useContext(context))(self.use) as React.FC<P>,
Effect.runSyncWith(React.useContext(context))(self.use) as React.FC<P>,
props,
)
})