Skip to content

Instantly share code, notes, and snippets.

View arxpoetica's full-sized avatar
🌼
Hope for a better world

Robert Hall arxpoetica

🌼
Hope for a better world
View GitHub Profile
{
"errors": [
{
"message": "Assignment to constant variable.",
"locations": [
{
"line": 2,
"column": 3
}
],
/* global localStorage */
import { writable } from 'svelte/store'
const storage = typeof localStorage !== 'undefined' ? localStorage : {
removeItem: key => { if (storage[key]) { delete storage[key] } },
}
/**
* Tracks storage both in `localStorage` and in svelte's `writable` stores
* Usage: `const name = storable('name', 'arxpoetica')`