Skip to content

Instantly share code, notes, and snippets.

View ilsubyeega's full-sized avatar

ilsubyeega

View GitHub Profile

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@ilsubyeega
ilsubyeega / localStorageStore.js
Created June 7, 2020 02:26 — forked from joshnuss/localStorageStore.js
LocalStorage store for Svelte.js
// Svelte store backed by window.localStorage
// Persists store's data locally
import {writable as internal, get} from 'svelte/store'
// wraps a regular writable store
export function writable(key, initialValue) {
// create an underlying store
const store = internal(initialValue)
const {subscribe, set} = store
// get the last value from localStorage