useMemoLayer
All checks were successful
Lint / lint (push) Successful in 15s

This commit is contained in:
Julien Valverdé
2025-07-01 00:23:45 +02:00
parent 8be1295e2f
commit 7cc0a68170
2 changed files with 15 additions and 8 deletions

View File

@@ -2,7 +2,6 @@ import { Box, TextField } from "@radix-ui/themes"
import { createFileRoute } from "@tanstack/react-router"
import { Console, Effect, Layer, pipe, Ref, Runtime, SubscriptionRef } from "effect"
import { ReactComponent, ReactHook, ReactManagedRuntime } from "effect-components"
import * as React from "react"
const LogLive = Layer.scopedDiscard(Effect.acquireRelease(
@@ -52,12 +51,7 @@ const MyRoute = pipe(
</Box>
{yield* ReactComponent.use(MyTestComponent, C => <C />).pipe(
Effect.provide(React.useMemo(() =>
Effect.context<SubService>().pipe(
Effect.provide(SubService.Default),
Runtime.runSync(runtime),
),
[]))
Effect.provide(yield* ReactHook.useMemoLayer(SubService.Default))
)}
</>
}),