Skip to content

Instantly share code, notes, and snippets.

@blacksonic

blacksonic/store.js

Created Jul 22, 2020
Embed
What would you like to do?
Svelte Testing Crash Course - part 8
import { writable } from 'svelte/store';
export const createStore = () => {
const state = writable('Click to modify');
return {
state,
onModify(value) {
state.update(() => value);
}
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.