Skip to content

Commit

Permalink
chore: remove Event parameter from clear
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanmylee committed May 10, 2022
1 parent 22bf019 commit b089429
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/plugins/useSortBy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export type SortByPropSet = NewTablePropSet<{
'thead.tr.th': {
order: 'asc' | 'desc' | undefined;
toggle: (event: Event) => void;
clear: (event: Event) => void;
clear: () => void;
disabled: boolean;
};
}>;
Expand Down Expand Up @@ -91,7 +91,7 @@ export type WritableSortKeys = Writable<SortKey[]> & {
clearId: (id: string) => void;
};

const shiftClickIsMultiSortEvent = (event: Event) => {
const isShiftClick = (event: Event) => {
if (!(event instanceof MouseEvent)) return false;
return event.shiftKey;
};
Expand All @@ -100,7 +100,7 @@ export const useSortBy =
<Item>({
initialSortKeys = [],
disableMultiSort = false,
isMultiSortEvent = shiftClickIsMultiSortEvent,
isMultiSortEvent = isShiftClick,
}: SortByConfig = {}): UseTablePlugin<
Item,
{
Expand Down Expand Up @@ -177,7 +177,7 @@ export const useSortBy =
multiSort: disableMultiSort ? false : isMultiSortEvent(event),
});
};
const clear = (_: Event) => {
const clear = () => {
if (!cell.isData) return;
if (disabledSortIds.includes(cell.id)) return;
sortKeys.clearId(cell.id);
Expand Down

0 comments on commit b089429

Please sign in to comment.