Comment

Comment by diggan

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.
parent diggan 9 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton