diff options
author | Ivan Chen <ivan@tagg.id> | 2021-04-20 18:01:40 -0400 |
---|---|---|
committer | Ivan Chen <ivan@tagg.id> | 2021-04-20 18:01:40 -0400 |
commit | bb1479dfcd8daad8ef2593d4ac65a0b1239a6139 (patch) | |
tree | ca3d73f914ccacb232f54011b7d6299984e17140 /src/utils/hooks.ts | |
parent | c4e76811cae6cf14d5cc8daed9317f808087ed77 (diff) |
linted
Diffstat (limited to 'src/utils/hooks.ts')
-rw-r--r-- | src/utils/hooks.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils/hooks.ts b/src/utils/hooks.ts index 3914ef48..336ac26c 100644 --- a/src/utils/hooks.ts +++ b/src/utils/hooks.ts @@ -4,10 +4,10 @@ import {useEffect, useState} from 'react'; export const useAsyncStorage = (key: string, defaultValue: string) => { const [storedValue, setStoredValue] = useState<string>(defaultValue); - const getStoredItem = async (key: string, defaultValue: string) => { + const getStoredItem = async (currentKey: string, currentValue: string) => { try { - const item = await AsyncStorage.getItem(key); - const value = item ? item : defaultValue; + const item = await AsyncStorage.getItem(currentKey); + const value = item ? item : currentValue; setStoredValue(value); } catch (error) { console.log(error); |