@expandorg/components
Advanced tools
Comparing version 0.2.90 to 0.2.91
@@ -57,2 +57,3 @@ // @flow | ||
lsRead, | ||
lsRemove, | ||
} from './src/components/hooks/useLocalStorage'; | ||
@@ -74,2 +75,3 @@ import usePrevious from './src/components/hooks/usePrevious'; | ||
lsRead, | ||
lsRemove, | ||
AutocompleteInput, | ||
@@ -76,0 +78,0 @@ Suggestions, |
{ | ||
"name": "@expandorg/components", | ||
"version": "0.2.90", | ||
"version": "0.2.91", | ||
"description": "expand UI components library", | ||
@@ -35,3 +35,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "7581e061e807a78b0151fc1610222b9580697f08" | ||
"gitHead": "700cec31f2370d456c6ab674267b7635555af2d5" | ||
} |
@@ -21,2 +21,10 @@ // @flow | ||
export function lsRemove(key: string) { | ||
try { | ||
window.localStorage.removeItem(key); | ||
} catch (error) { | ||
console.log(error); | ||
} | ||
} | ||
export function useLocalStorage(key: string, initial?: any) { | ||
@@ -23,0 +31,0 @@ const [saved, setSaved] = useState(() => lsRead(key, initial)); |
203129
3940