mirror of https://github.com/ctk-hq/ctk
feat: created `useLocalStorageJWTKeys` hook
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…
Reference in New Issue