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 | |
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')
-rw-r--r-- | apps/Notes/hooks/useNotes.js | 4 | ||||
-rw-r--r-- | apps/Notes/hooks/useSort.js | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/apps/Notes/hooks/useNotes.js b/apps/Notes/hooks/useNotes.js index 586ceeb..d02be10 100644 --- a/apps/Notes/hooks/useNotes.js +++ b/apps/Notes/hooks/useNotes.js @@ -1,7 +1,7 @@ import useSWR from 'swr' -export default function useNotes(){ +export default function useNotes () { const { data: notes, error, mutate: mutateNotes } = useSWR('/api/notes') - return {notes, mutateNotes, error} + return { notes, mutateNotes, error } } 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)) { |