Skip to content

Commit

Permalink
[useSort] Add sort order custom sortMethod
Browse files Browse the repository at this point in the history
Added sort order as parameter for calling sortMethod(will be useful to provide more control in custom sortMethod)
  • Loading branch information
gargroh committed Oct 25, 2019
1 parent 4b7c856 commit 4add851
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin-hooks/useSortBy.js
Expand Up @@ -268,7 +268,7 @@ function useMain(instance) {

// Return the correct sortFn.
// This function should always return in ascending order
return (a, b) => sortMethod(a, b, sort.id)
return (a, b) => sortMethod(a, b, sort.id, sort.desc)
}),
// Map the directions
availableSortBy.map(sort => {
Expand Down

0 comments on commit 4add851

Please sign in to comment.