How to create dynamic substore or substate with ngxs

Viewed 932

I have created a module to manage my CRUD scaffolding. I currently define a context which I define for all my "collections" based on the URL in the router. ie: #/posts/admin tells me the collection is posts and my scaffolding is a list #/posts/admin/edit/xxxx is scaffolding for editing post xxxx. For each type of scaffolding I defined list of fields and actions. It is working fine but I would like to replace with with States from NGXS.

My thinking would be to define a base State for each scaffolding screens and then for each collection to create a substate.

How do you create a State which can be extended with its own set of actions.

0 Answers
Related