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

demo-store.ts

13 lines269 Bytes

1import { Derived, Store } from '@tanstack/store'
2​
3export const store = new Store({
4 firstName: 'Jane',
5 lastName: 'Smith',
6})
7​
8export const fullName = new Derived({
9 fn: () => `${store.state.firstName} ${store.state.lastName}`,
10 deps: [store],
11})
12​
13fullName.mount()