@crikey/stores-svelte
v0.0.16
Published
Provide svelte compatible implementations of `readable`, `writable`, `derived` and `get`.
Downloads
9
Readme
@crikey/stores-svelte
Provide svelte compatible implementations of readable
, writable
, derived
and get
.
This package is a simple convenience wrapper around @crikey/stores-base
utilising the
trigger_safe_not_equal
trigger function to mirror svelte greedy signaling semantics.
See @crikey/stores-svelte for full documentation.
API
Store creation functions:
constant
- Create aReadable
store with a fixed valuereadable
- Create aReadable
storewritable
- Create aWritable
storederive
- Create aReadable
store derived from the resolved values of other storestransform
- Create aWritable
store by applying transform functions when reading and writing values
Utility functions:
get
- Retrieve the value of a store
Installation
# pnpm
$ pnpm add @crikey/stores-svelte
# npm
$ npm add @crikey/stores-svelte
# yarn
$ yarn add @crikey/stores-svelte
Usage
Standard usage should be a drop in replacement for svelte/store
.