mirror of
https://github.com/Nezumi-2711/next-gdrive-index.git
synced 2026-09-22 20:01:36 +00:00
prettier format
This commit is contained in:
@@ -23,8 +23,7 @@ export default function useLocalStorage<T>(key: string, initialValue: T) {
|
||||
// Create dispatch function to set or remove localStorage
|
||||
const setValue: SetValue<T> = (value) => {
|
||||
try {
|
||||
const valueToStore =
|
||||
value instanceof Function ? value(storedValue) : value;
|
||||
const valueToStore = value instanceof Function ? value(storedValue) : value;
|
||||
setStoredValue(valueToStore);
|
||||
window.localStorage.setItem(key, JSON.stringify(valueToStore));
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user