JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q38304F
  • License MIT

Consume svelte-stores from react, with hooks

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.

  1. npm install use-svelte-store
  2. Create a file stores.ts.
  3. Create a svelte store: export const foos = writable<Foo[]>([]);
  4. Use the store in a component: const $foos = useReadable(foos);
  5. Update the store in a component: foos.update(f => f.concat(new Foo()))