Skip to content

Commit

Permalink
[useSort] Add sort order custom sortMethod (#1615)
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 authored and tannerlinsley committed Jan 9, 2020
1 parent 5778bc3 commit 6ebf318
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/plugin-hooks/useSortBy.js
Expand Up @@ -296,7 +296,7 @@ function useInstance(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 6ebf318

Please sign in to comment.