0.0.2 • Published 1 year ago

jotai-svelte v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

jotai-svelte

Primitive and flexible state management for Svelte based on Jotai.

Experimental. Check this for more info.

Installation

pnpm add jotai jotai-svelte

Usage

import { atom } from 'jotai-svelte'

export const countAtom = atom(0)
<script lang="ts">
  import { useAtom } from 'jotai-svelte'
  import { countAtom } from './atoms'
  const count = useAtom(countAtom)
</script>

<button on:click={() => count.update(prev => prev + 1)}>
  Clicks: {$count}
</button>

Read more about Jotai here.

License

MIT