Skip to content

One big store or bunch of small stores #745

Answered by dai-shi
FluffyDiscord asked this question in Q&A
Discussion options

You must be logged in to vote

Should mostly be the same.

Does this help?

## You can split states
Creating a state with nested object.
```js
const state = proxy({
obj1: { a: 1 },
obj2: { b: 2 },
})
```
You can then split the state into pieces. They are both proxies.
```js
const obj1State = state.obj1
const ojb2State = state.obj2
```
## You can combine states
You can create states and then combine them.
```js
const obj1State = proxy({ a: 1 })
const obj2State = proxy({ a: 2 })
const state = proxy({

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by FluffyDiscord
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants