svelte-observable-store Svelte Themes

Svelte Observable Store

A Svelte writable store that includes a get() method to retrieve the current value.

Svelte Observable Store

A writable store that includes a get() method to retrieve the current value.

import { syncable } from 'svelte-observable-store'
const count = syncable(0)
console.log(count.get()) // 0
count.set(5)
console.log(count.get()) // 5

This utility can be preferred over Svelte's built-in get(store) function, as it avoids importing an extra function and helps maintain cleaner code.

Top categories

Loading Svelte Themes