chore: initialize project
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { Store } from '@tanstack/store'
|
||||
|
||||
export const store = new Store({
|
||||
firstName: 'Jane',
|
||||
lastName: 'Smith',
|
||||
})
|
||||
|
||||
export const fullName = new Store(
|
||||
`${store.state.firstName} ${store.state.lastName}`,
|
||||
)
|
||||
|
||||
store.subscribe(() => {
|
||||
fullName.setState(() => `${store.state.firstName} ${store.state.lastName}`)
|
||||
})
|
||||
Reference in New Issue
Block a user