6 ms·
You can create a custom store in Svelte and do almost the same: import { writable } from 'svelte/store'; export default function(state) { const { subscribe,
by PaulMaly 7y ago
You can create a custom store in Svelte and do almost the same:
import { writable } from 'svelte/store';
export default function(state) {
const { subscribe, set, update } = writable(state);
return {
subscribe,
getArea() { ... }
};
};