Config
The config object is completely optional and currently only provides a property to control sorting.
#
Options#
Overviewconst config = { sort: 'desc' // 'asc' | 'desc' | null, default: 'desc'}
#
DefaultsThis is an example of the default config options if no config object is provided.
const defaultConfig = { sort: 'desc'}
#
Referencesort
[string | null]#
Default: 'desc'
The sort option allows you to specify the order your records are returned in. If want to handle this yourself outside of Rankr, pass in null
.
values | description |
---|---|
'desc' | returns records in descending order (highest score to lowest score) |
'asc' | returns records in ascending order (lowest score to highest score) |
null | returns records in the same order they were provided. |