0.2.0 #18

Merged
Thilawyn merged 44 commits from next into master 2025-10-24 01:36:27 +02:00
Showing only changes of commit 499e1e174b - Show all commits

View File

@@ -41,7 +41,7 @@ export class Todo extends Component.makeUntraced("Todo")(function*(props: TodoPr
completedAtField, completedAtField,
] = yield* Component.useOnChange(() => Effect.gen(function*() { ] = yield* Component.useOnChange(() => Effect.gen(function*() {
const indexRef = Match.value(props).pipe( const indexRef = Match.value(props).pipe(
Match.tag("new", () => Subscribable.make({ get: Effect.succeed(-1), changes: Stream.empty })), Match.tag("new", () => Subscribable.make({ get: Effect.succeed(-1), changes: Stream.make(-1) })),
Match.tag("edit", ({ id }) => state.getIndexSubscribable(id)), Match.tag("edit", ({ id }) => state.getIndexSubscribable(id)),
Match.exhaustive, Match.exhaustive,
) )
@@ -78,7 +78,11 @@ export class Todo extends Component.makeUntraced("Todo")(function*(props: TodoPr
] as const ] as const
}), [props._tag, props._tag === "edit" ? props.id : undefined]) }), [props._tag, props._tag === "edit" ? props.id : undefined])
const [index, size, canSubmit] = yield* Subscribable.useSubscribables(indexRef, state.sizeSubscribable, form.canSubmitSubscribable) const [index, size, canSubmit] = yield* Subscribable.useSubscribables(
indexRef,
state.sizeSubscribable,
form.canSubmitSubscribable,
)
const submit = yield* Form.useSubmit(form) const submit = yield* Form.useSubmit(form)
const TextFieldFormInputFC = yield* TextFieldFormInput const TextFieldFormInputFC = yield* TextFieldFormInput