Package Exports
- use-svelte-store
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (use-svelte-store) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
use-svelte-store
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
stores.ts
. - 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()))