cartwith several items associated to its state. Beneath that we have a
savedobject which represents another state slice. To express this relationship with NGXS, we simply need to use the
childrenproperty in the
setStatefunction in the parent
CartStatestate as your child state will erase. Assume you've got an action called
setStatefunction - we would have overwritten the whole state value and our sub-state
CartSavedStatewould be erased. The
patchStatefunction allows us to update only needed properties and preserve our sub-state safe and sound.