Better HN
topnewbestaskshowjobs
Log inSign up

PaulMaly

3 karma · joined Oct 29, 2019 (7y ago) · 1 submissions

Submissions

comment 7y ago · link · parent

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() { ... }
  };
};