Skip to main content

@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

ParameterTypeDescription
listPixelBox[]
newItemPixelBox
sortPriority(box: PixelBox) => number
Returns:

void