From a11c1a16a38f0cda985f6b1bed58ec3e24f586fd Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 23 May 2021 18:25:17 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=8A=20Renamed=20inner=20`value`=20vari?= =?UTF-8?q?able=20to=20`val`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nest_frontend/hooks/useLocalStorageState.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nest_frontend/hooks/useLocalStorageState.js b/nest_frontend/hooks/useLocalStorageState.js index 4c30613..49f239b 100644 --- a/nest_frontend/hooks/useLocalStorageState.js +++ b/nest_frontend/hooks/useLocalStorageState.js @@ -35,10 +35,10 @@ export default function useLocalStorageState(key, def) { * Save a value to the {@link localStorage}. */ const save = useCallback( - (value) => { + val => { if(localStorage) { console.debug(`Saving ${key} to localStorage...`) - localStorage.setItem(key, JSON.stringify(value)) + localStorage.setItem(key, JSON.stringify(val)) } else { console.warn(`Can't save ${key}; localStorage doesn't seem to be available...`) @@ -51,9 +51,9 @@ export default function useLocalStorageState(key, def) { * Set `value` and save it to the {@link localStorage}. */ const setAndSave = useCallback( - (value) => { - setValue(value) - save(value) + val => { + setValue(val) + save(val) }, [save], )