svelte-partial-stores
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Svelte Partial Stores

Trigger Stores

The store will only fire an update when the fields specified by the trigger are changed. For performance, only fields specified by the trigger are stored and compared.

import { triggered } from 'svelte-partial-stores';

const user = writable({
    name: {
        first: 'Jacob',
        last: 'Zwang'
    },
    id: 'id'
});

// will only fire an update when `id` and/or `name.last` is changed
const user2 = triggered(store, {
    id: true,
    name: {
        last: true
    }
});

Package Sidebar

Install

npm i svelte-partial-stores

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

3.28 kB

Total Files

10

Last publish

Collaborators

  • jacobzwang