A wrapper for any Svelte Store instance that gives it Browser Storage persistence, with configuration options available at instantiation or runtime.
@drtrt/give-svelte-store-previous-behaviour is used to persist state in Fluent API Generator |
---|
give-svelte-store-persistence-behaviour
does not instantiate a Store. Rather, it wraps an existing Store, leaving you with full control over how your Store is instantiated. This is important because:
You are not prevented from further adding your own augmentations to the Store, either before it has been given Previous Behaviour or after.
It allows you to apply other wrappers, too, such as @drtrt/give-svelte-store-previous-behaviour.
This philosophy allows for a flexible, compositional approach, as is used in the core Svelte Store code that creates readable
and derived
Stores.
A full set of types is available for TypeScript consumers.
Full detail is available in the dedicated Types documentation.
The Change Log for this package is available in the GitHub Repo, here.