0.1.3 #4
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user