diff options
author | 2021-09-06 23:13:22 +0200 | |
---|---|---|
committer | 2021-09-06 23:13:22 +0200 | |
commit | 569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a (patch) | |
tree | 8d1cb94a56d60b9d726222277b7516fc59895613 /apps/Notes/hooks/useSort.js | |
parent | 275bd1d0a9aea90696c145cf992d522a0d6b0aa8 (diff) | |
download | my_apps-569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a.tar.gz my_apps-569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a.tar.bz2 my_apps-569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a.zip |
added stadard linter
Diffstat (limited to 'apps/Notes/hooks/useSort.js')
-rw-r--r-- | apps/Notes/hooks/useSort.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/apps/Notes/hooks/useSort.js b/apps/Notes/hooks/useSort.js index 78c01b4..e3cf230 100644 --- a/apps/Notes/hooks/useSort.js +++ b/apps/Notes/hooks/useSort.js @@ -1,12 +1,12 @@ -import {useState} from 'react' -import {faSortAmountDown, faSortAmountUp} from '@fortawesome/free-solid-svg-icons' -import {FontAwesomeIcon} from '@fortawesome/react-fontawesome' +import { useState } from 'react' +import { faSortAmountDown, faSortAmountUp } from '@fortawesome/free-solid-svg-icons' +import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' const useSort = (d) => { const [sort, setSort] = useState(d) - const sortedBy = s => Math.abs(sort) === s && <FontAwesomeIcon icon={sort>0 ? faSortAmountDown : faSortAmountUp} /> - const sortBy = s => sort === s ? setSort(-1*s) : setSort(s) + const sortedBy = s => Math.abs(sort) === s && <FontAwesomeIcon icon={sort > 0 ? faSortAmountDown : faSortAmountUp} /> + const sortBy = s => sort === s ? setSort(-1 * s) : setSort(s) const sortFn = (a, b) => { const d = sort > 0 ? 1 : -1 switch (Math.abs(sort)) { |