Skip to content

Instantly share code, notes, and snippets.

@sonicoder86
Created July 22, 2020 16:05
Show Gist options
  • Save sonicoder86/2860fb93c5d0ccf10743de74b6f1a7b4 to your computer and use it in GitHub Desktop.
Save sonicoder86/2860fb93c5d0ccf10743de74b6f1a7b4 to your computer and use it in GitHub Desktop.
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