Nesting
Last updated
Was this helpful?
Last updated
Was this helpful?
As we know, ActiveJS doesn't have a single store, it has storage , hence instead of creating slices, we create groups.
When you need to combine multiple storage Units (or even other ActiveJS constructs) you can do that using the , to build a nested data structure, instead of storing deeply nested values in the Units.
To do proper nesting and to make sure that you use ActiveJS Units as intended, you should try to keep the values of the Units flat, i.e.: as less nested as possible.
This would allow you to have clear and granular control over the state of your App. Updating and accessing the stored values would be much easier and efficient as well. For example:
Even if you followed the above advice and kept your Units flat you might still want to create an even finer chunk of the information. For that purpose, you can create a from a Unit's value.