This is fork of react-use-svelte-store but you don't need svelte in dependency, just do
npm install use-svelte-store, play with example, you can find more details from original project react-use-svelte-store.
How do I get started?
I'm assuming you have react installed. If not, well, figuring that out is on you.
npm install use-svelte-store
- Create a file
- Create a svelte store:
export const foos = writable<Foo>();
- Use the store in a component:
const $foos = useReadable(foos);
- Update the store in a component:
foos.update(f => f.concat(new Foo()))