give-svelte-store-persistence-behaviour

Give Svelte Store Persistence Behaviour

A wrapper for any Svelte Store instance that gives it Browser Storage persistence, with a range of configuration options available at instantiation or runtime.

give-svelte-store-persistence-behaviour

A wrapper for any Svelte Store instance that gives it Browser Storage persistence, with configuration options available at instantiation or runtime.

It's a wrap

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 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.

Types

A full set of types is available for TypeScript consumers.

Full detail is available in the dedicated Types documentation.

Questions

Why did you spell 'behaviour' wrong?

Answer: I didn't. 😉

Release History

The Change Log for this package is available in the GitHub Repo, here.

Top categories

Loading Svelte Themes