how to efficiently make nested data structures in solid
Hello, I am new to Solid atm, but am aware of some reactivity principles like singals, memos, effects, etc. I was wondering what is the best way to go about implementing UI for a data structure that is nested (one of its elements is itself). For my usecase. I have an object called Questions. Each question can have sub-questions inside it , the object basically looks like this
now, in theory, the Ui for a questions body shouldn`t update when its sub_questions update, but I am having trouble understanding how to implement something like this with signals, I come from React so I have never really actually used signals, so pls help me out. Any help is appreciated thank you
5 Replies
put it all in a store, each field and array element will effectively become individual signals that allow fine-grained updates
is that another SolidJS API function? idk what a store is exactly, I`m assuming you mean something like this.
yeah stores are a solid thing https://www.solidjs.com/tutorial/stores_nested_reactivity
i'd recommend you go through the whole tutorial before building your own stuff
thanks
you can also nest without a store: https://discord.com/channels/722131463138705510/1212520888218427433/1212529237114880081