@@ -37,10 +37,7 @@ export const Todo = Component.make(function* Todo(props: TodoProps) {
|
||||
|
||||
const ref = yield* Hook.useMemo(() => Match.value(props).pipe(
|
||||
Match.tag("new", () => Effect.andThen(makeTodo, SubscriptionRef.make)),
|
||||
Match.tag("edit", ({ index }) => Effect.succeed(SubscriptionSubRef.makeFromGetSet(state.ref, {
|
||||
get: parent => Chunk.unsafeGet(parent, index),
|
||||
set: (parent, v) => Chunk.replace(parent, index, v),
|
||||
}))),
|
||||
Match.tag("edit", ({ index }) => Effect.succeed(SubscriptionSubRef.makeFromChunkRef(state.ref, index))),
|
||||
Match.exhaustive,
|
||||
), [props._tag, props.index])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user