Skip to content

Conversation

jxn-30
Copy link
Contributor

@jxn-30 jxn-30 commented Sep 8, 2023

This is a feature proposal that adresses #177

The following new props have been added:

  • sort-function
  • multi-sort-function

sort-function

takes the following arguments:

  • a: Item
  • b: Item
  • sortBy: string
  • sortDesc: boolean
  • getItemValue: typeof getItemValueFn
  • defaultSortFunction: (a: Item, b: Item) => number

it should return a number, if a nullish (undefined and null) is returned, the default sort function will automatically be applied.

multi-sort-function

takes the following arguments:

  • sortByArr: string[]
  • sortDescArr: boolean[]
  • itemsToSort: Item[]
  • index: number

it should return an Item[] (Array of Item-Objects). There is no "fallback to default if undefined returned" as for sort-function to allow more controll over the sorting.

Copy link
Contributor

@mrhammadasif mrhammadasif left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change of Coding Style is not recommended. Also, why do we have change in package-lock.json file?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants