Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deeply nested state objects and arrays #192

Open
DanielMazurkiewicz opened this issue Dec 14, 2023 · 1 comment
Open

Deeply nested state objects and arrays #192

DanielMazurkiewicz opened this issue Dec 14, 2023 · 1 comment

Comments

@DanielMazurkiewicz
Copy link

DanielMazurkiewicz commented Dec 14, 2023

Looking into a code and trying to wrap my head around a topic of dynamic deeply nested object and array structures. I'm pretty sure someone here thought it through and I don't have to rediscover things.

Lets say I have this example:

const items = vanX.reactive([])
return vanX.list(ul, items, v => SomeComponent(v))

and then I add item:

items.push({
    type: "some_sub_items",
    sub_items: []
})

can I use vanX.list on sub_items?

@Tao-VanJS
Copy link
Member

Yes. I think that should be possible. You might need to manually cast the nested field into a Reactive object in order to use vanX.list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants