#hooks inside stores

3 messages · Page 1 of 1 (latest)

solemn meadow
#

Why not use const [state, setState] = createStore({ count: 0 }) ? Where is the advantage to creating the signal manually?

solemn meadow
#

You can use makePersisted for a store. You can also put a store in another store. However, if you want persistence, you need to use the setter returned from makePersisted.

#

If you wanted to use makePersisted for only one property of a store, you could write a simple wrapper that accesses and sets the property.