Skip to content
Source
Sign inSign up
TanStack/form
Open History to see the last commit

Subscribe.svelte

16 lines409 Bytes

1<script lang="ts">
2 import { useStore } from '@tanstack/svelte-store'
3​
4 // Don't bother typing this out, this component is only usable through a wrapper
5 interface Props {
6 children: any
7 store: any
8 selector?: (state: any) => any
9 }
10​
11 let { children, store, selector = (state) => state }: Props = $props()
12​
13 const value = useStore(store, selector)
14</script>
15​
16{@render children(value.current)}