Interface CompareFn<T>
interface CompareFn<T> {
subscribe?:
| ((this: void, indexUpdate: IndexUpdateFn) => () => void)
| ((this: void, run: (value: any) => void) => () => void);
(a: T, b: T): number;
}
subscribe?:
| ((this: void, indexUpdate: IndexUpdateFn) => () => void)
| ((this: void, run: (value: any) => void) => () => void);
(a: T, b: T): number;
}
Type Parameters
- T
any- Type of data.
Properties
Optionalsubscribe
subscribe?:
| ((this: void, indexUpdate: IndexUpdateFn) => () => void)
| ((this: void, run: (value: any) => void) => () => void)
| ((this: void, indexUpdate: IndexUpdateFn) => () => void)
| ((this: void, run: (value: any) => void) => () => void)
Optional subscribe function following the Svelte store / subscribe pattern.
A callback function that compares two values. Return > 0 to sort 'b' before 'a'; < 0 to sort 'a' before 'b'; or 0 to keep original order of 'a' & 'b'.
This function has an optional subscribe function that follows the Svelte store Subscriber pattern. If a subscribe function is provided automatic updates to the reduced index is performed.