@microsoft/fast-colors > insertIntoSortedList
insertIntoSortedList() function
Adds a newItem to an already sorted list without needing to do a full re-sort. Higher sort priority puts the newItem closer to the start (index 0) of the list.
Signature:export declare function insertIntoSortedList(list: PixelBox[], newItem: PixelBox, sortPriority: (box: PixelBox) => number): void;
Parameters
Parameter | Type | Description |
---|---|---|
list | PixelBox[] | |
newItem | PixelBox | |
sortPriority | (box: PixelBox) => number |
void