|
|
|
|
|
by diggan
3394 days ago
|
|
Not that I disagree with your other arguments but this one sticks out: > Except if you want to store objects/arrays/numbers (localStorage only supports strings) My normal usage of localStorage usually looks like this: const getItem = (item) => { JSON.parse(window.localStorage.getItem(item)) }
// and
const setItem = (item, val) { window.localStorage.setItem(item, JSON.stringify(val)) }
And then you won't have issues with any type. |
|