mirror of
https://github.com/pds-nest/nest.git
synced 2024-11-22 13:04:19 +00:00
🧊 Renamed inner value
variable to val
This commit is contained in:
parent
1be5584de9
commit
a11c1a16a3
1 changed files with 5 additions and 5 deletions
|
@ -35,10 +35,10 @@ export default function useLocalStorageState(key, def) {
|
||||||
* Save a value to the {@link localStorage}.
|
* Save a value to the {@link localStorage}.
|
||||||
*/
|
*/
|
||||||
const save = useCallback(
|
const save = useCallback(
|
||||||
(value) => {
|
val => {
|
||||||
if(localStorage) {
|
if(localStorage) {
|
||||||
console.debug(`Saving ${key} to localStorage...`)
|
console.debug(`Saving ${key} to localStorage...`)
|
||||||
localStorage.setItem(key, JSON.stringify(value))
|
localStorage.setItem(key, JSON.stringify(val))
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
console.warn(`Can't save ${key}; localStorage doesn't seem to be available...`)
|
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}.
|
* Set `value` and save it to the {@link localStorage}.
|
||||||
*/
|
*/
|
||||||
const setAndSave = useCallback(
|
const setAndSave = useCallback(
|
||||||
(value) => {
|
val => {
|
||||||
setValue(value)
|
setValue(val)
|
||||||
save(value)
|
save(val)
|
||||||
},
|
},
|
||||||
[save],
|
[save],
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue