As I delve into the Redux pattern, I realize the importance of storing only plain objects in the Store. However, I find myself wanting to use more complex objects with methods like "hasParent", "isReadonly", and "isValid" in my application.
While ngrx allows for storing such objects, it can create a plethora of issues down the line.
So, how should I handle this dilemma of storing complex objects? I have two potential solutions in mind:
A) - Serialize the object into plain data before saving it to the store - Map the plain data back to the object when reading from the store (either using a mapper or manually with an object constructor and setters) B) - Abandon the use of classes/objects entirely and rely solely on plain data - Move the hasParent, isReadonly, isValid methods to helpers/services insteadUnfortunately, neither of these options is without drawbacks. Which approach do you think is the better choice? Are there any other strategies I could consider?