SortFunction signature should match Array.sort (#29468)

-1 and 1 aren't the only numbers allowed. Any number less than or greater than 0 will sort the item properly.
This enables shortcuts like (a, b) => a - b;
Restricting the signature to -1 | 0 | 1 is a mistake.
This commit is contained in:
nixxquality
2018-10-10 21:53:18 +02:00
committed by Andy
parent 95fdf92cc2
commit 3d6ded6cd7

View File

@@ -27,7 +27,7 @@ export type SortedChangeFunction = (newSorted: SortingRule[], column: any, addit
export type FilteredChangeFunction = (newFiltering: Filter[], column: any, value: any) => void;
export type ExpandedChangeFunction = (column: any, event: any, isTouch: boolean) => void;
export type ResizedChangeFunction = (newResized: Resize[], event: any) => void;
export type SortFunction = (a: any, b: any, desc: any) => -1 | 0 | 1;
export type SortFunction = (a: any, b: any, desc: any) => number;
export interface Resize {
id: string;