sveltio
v2.0.0
Published
Proxy-state for Svelte using Valtio.
Readme
sveltio
State management solution for Svelte using proxies. Powered by valtio.
Installation
pnpm add valtio sveltioUsage
// store.ts
import { proxy } from 'sveltio'
export const state = proxy({ count: 0 })Read from snapshots, mutate the source.
<script lang="ts">
import { useSnapshot } from 'sveltio'
import { state } from './store'
const snap = useSnapshot(state)
</script>
<button on:click={() => state.count++}>
Clicks: {$snap.count}
</button>For more info on how to use valtio, check out the official docs.
License
MIT
