API returned from {@link createReorderCommitHandler}
ReorderCommitHandler
Interface
projects/forms/select/shared/reorder-commit-handler.ts
Import#
import { ReorderCommitHandler } from '@cngx/forms/select'
Description#
API returned from createReorderCommitHandler.
Index#
Methods
Methods#
dispatch(next: T[], previous: T[], fromIndex: number, toIndex: number, option: CngxSelectOptionDef<T> | null)Run a reorder through the commit flow.
- No commit: write
values, fireonReorder+onAnnounce. - Optimistic: write, emit, begin commit. Success reconciles with the server's canonicalised value; error rolls back.
- Pessimistic: hold
values, emit'pending', begin commit. Success writes + emits; error leavesvaluesuntouched.
Always writes on success regardless of same-membership - the point
of this factory is to bypass sameArrayContents.
@paramnext
T[]@paramprevious
T[]