The data that we deal with within an application comes in all shapes and sizes. However, these different shapes are fairly limited and can be listed as:
- Singular values: These include primitives like numbers, booleans, strings, null, undefined, dates, and so on.
- Lists: Your typical list of items where each item is one of a kind. It is generally a good practice to avoid putting items of different data types in the same list. This creates homogenous lists which are easy to reason about.
- Hierarchy: Many of the structures we see in UI are hierarchical, like a hierarchy of files and f0lders, parent-child relationships, groups and items, and so on.
- Composite: A combination of some or all of the preceding shapes. Most real world data is in this form.
MobX gives us the API to model each of these shapes and we have already seen some examples of this in earlier chapters...