Remove Model Instances from the Tree

Share this video with your friends

Send Tweet

In this lesson we will dive a bit more into the tree semantics of MST.

In this lesson you will learn:

  • Actions can only modify their own subtree
  • The use of getParent to find the parent of a model instance
  • Using destroy to remove an instance entirely from the tree
hipertracker
hipertracker
~ 3 years ago

Can you delegate the method to remove the item from the top of the tree? Without parent()?

Does MST need to define all action on the top level of the model? Can it be modularized? So the model's nested branch can be defined in a separate file together with some actions to operate only on that branch?

Michel Weststrate
Michel Weststrate(instructor)
~ 3 years ago

Hey hipertracker,

These are quite extensive conceptual questions, best ask them at: https://spectrum.chat/mobx-state-tree where the community can chime in.

Thanks!