svelte-runes-store is a svelte/sveltekit package to build (persistent) svelte stores using runes.
- WORKS WITH SVELTE 5 ONLY.
- USES THE SVELTE 5 RUNES.
- PERSISTENT AND NON PERSISTENT STORES.
- TYPESCRIPT SUPPORT.
npm install svelte-runes-store
To run the examples from /src/routes
:
git clone https://github.com/joaquimnetocel/svelte-runes-store.git
cd svelte-runes-store
npm install
npm run dev
functionCreateStore
: Function to create the store.functionReadStore
: Function to read the store.
- PROPS OF
functionCreateStore
:
PARAMETER | DESCRIPTION | TYPE | REQUIRED | DEFAULT |
---|---|---|---|---|
value |
INITIAL VALUE OF THE STORE. | Generic |
YES | - |
name |
STORE NAME. | string |
YES | - |
persistent |
PERSISTENT STORE (OR NOT). | boolean |
NO | false |
storage |
STORAGE TYPE. | localStorage OR sessionStorage |
NO | localStorage |
- PROPS OF
functionReadStore
:
PARAMETER | DESCRIPTION | TYPE | REQUIRED | DEFAULT |
---|---|---|---|---|
name |
STORE NAME. | string |
YES | - |