Projekt

Obecné

Profil

Stáhnout (324 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1 c7d2ced1 Václav Honzík
// TODO this could be replaced with redux library
2
const persist = (name: string, value: any) => {
3
    localStorage.setItem(name, JSON.stringify(value))
4
    return value
5
}
6
7
const load = (name: string) => {
8
    const item = localStorage.getItem(name)
9
    return item ? JSON.parse(item) : undefined
10
}
11
12
export { persist, load }