Fix
All checks were successful
Lint / lint (push) Successful in 11s

This commit is contained in:
Julien Valverdé
2025-07-06 02:25:12 +02:00
parent 5b6bb5863b
commit cbb7530f19
4 changed files with 18 additions and 18 deletions

View File

@@ -2,7 +2,7 @@ import * as Domain from "@/domain"
import { Button, Flex, TextArea } from "@radix-ui/themes"
import { GetRandomValues, makeUuid4 } from "@typed/id"
import { Chunk, Effect, Match, Option, Ref, Runtime, SubscriptionRef } from "effect"
import { ReactComponent, ReactHook } from "effect-fc"
import { Component, Hook } from "effect-fc"
import { SubscriptionSubRef } from "effect-fc/types"
import * as React from "react"
import { TodosState } from "./TodosState.service"
@@ -19,18 +19,18 @@ export type TodoProps = (
}
)
export const Todo = ReactComponent.make(function* Todo(props: TodoProps) {
export const Todo = Component.make(function* Todo(props: TodoProps) {
const runtime = yield* Effect.runtime()
const state = yield* TodosState
const ref = yield* ReactHook.useMemo(() => Match.value(props).pipe(
const ref = yield* Hook.useMemo(() => Match.value(props).pipe(
Match.tag("new", () => Effect.andThen(makeTodo, SubscriptionRef.make)),
Match.tag("edit", ({ ref }) => Effect.succeed(ref)),
Match.exhaustive,
), [props._tag, props.ref])
const contentRef = React.useMemo(() => SubscriptionSubRef.makeFromPath(ref, ["content"]), [ref])
const [todo] = yield* ReactHook.useSubscribeRefs(ref)
const [todo] = yield* Hook.useSubscribeRefs(ref)
return (
<Flex direction="column" align="stretch" gap="2">