feat: created `useLocalStorageJWTKeys` hook

pull/68/head
Samuel Rowe 3 years ago
parent 0f5d52795b
commit 5ee2505a85

@ -0,0 +1,15 @@
import { useMemo } from "react"
import { LOCAL_STORAGE } from "../constants"
const useLocalStorageJWTKeys = () => {
const jwtKeys = localStorage.getItem(LOCAL_STORAGE)
return useMemo(() => {
if (jwtKeys) {
return JSON.parse(jwtKeys)
}
return null
}, [jwtKeys])
}
export default useLocalStorageJWTKeys
Loading…
Cancel
Save