0.0.6 • Published 11 months ago
svelte-runes-store v0.0.6
svelte-runes-store
svelte-runes-store is a svelte/sveltekit package to build (persistent) svelte stores using runes.
VERSIONS
- WORKS WITH SVELTE 5 ONLY.
FEATURES
- USES THE SVELTE 5 RUNES.
- PERSISTENT AND NON PERSISTENT STORES.
- TYPESCRIPT SUPPORT.
DEMOS
INSTALLATION
npm install svelte-runes-store
EXAMPLES
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
COMPONENT STRUCTURE
functionCreateStore
: Function to create the store.functionReadStore
: Function to read the store.
PARAMETERS
- 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 | - |