0.1.3 #4

Merged
Thilawyn merged 90 commits from next into master 2025-08-23 03:07:28 +02:00
Showing only changes of commit 94c2ebb0ef - Show all commits

View File

@@ -97,7 +97,7 @@ export class Todo extends Component.makeUntraced(function* Todo(props: TodoProps
SubscriptionRef.updateEffect(state.ref, todos => Effect.Do.pipe(
Effect.bind("todo", () => ref),
Effect.bind("index", () => Chunk.findFirstIndex(todos, v => v.id === props.id)),
Effect.bind("previous", () => Chunk.get(todos, index - 1)),
Effect.bind("previous", ({ index }) => Chunk.get(todos, index - 1)),
Effect.andThen(({ todo, index, previous }) => index > 0
? todos.pipe(
Chunk.replace(index, previous),
@@ -117,7 +117,7 @@ export class Todo extends Component.makeUntraced(function* Todo(props: TodoProps
SubscriptionRef.updateEffect(state.ref, todos => Effect.Do.pipe(
Effect.bind("todo", () => ref),
Effect.bind("index", () => Chunk.findFirstIndex(todos, v => v.id === props.id)),
Effect.bind("next", () => Chunk.get(todos, index + 1)),
Effect.bind("next", ({ index }) => Chunk.get(todos, index + 1)),
Effect.andThen(({ todo, index, next }) => index < Chunk.size(todos) - 1
? todos.pipe(
Chunk.replace(index, next),