sorteo
@swyg/memo
for blazing fast performance!
Installation
npm install @swyg/sorteo
yarn install @swyg/sorteo
Usage
Functions:
getCompareByStringFn<T>(getValue: (x: T) => string, sortDirection: SortDirection = SortDirection.Ascending, fallback?: CompareFunction<T>): CompareFunction<T>
getCompareByNumberFn<T>(getValue: (x: T) => number, sortDirection: SortDirection = SortDirection.Ascending, fallback?: CompareFunction<T>): CompareFunction<T>
getCompareByDateFn<T>(getValue: (x: T) => Date, sortDirection: SortDirection = SortDirection.Ascending, fallback?: CompareFunction<T>): CompareFunction<T>
TODO
- Configure how
NaN
,undefined
,null
and/or''
are handled (e.g. always at the end, always at the start, depending on order param...).