Open reva2 opened 7 years ago
I also think it's a good idea to move the logic to the JsonApiDataStore
. Removing the now needed inheritance of JsonApiModel
of the data models will make it much easier to deal with the models in forms and components.
Any idea on when this modification could be released ? :)
Like said in #49, I can't use any application state container like ng2-redux, because I can't store my models as they contain some properties injected by JsonApiModel
and some circular references that cannot be passed into JSON.stringify
I think this is a great idea, right now its very tricky to properly test components and services as bringing in the models is not so trivial and very couple with the librarie's data storage like mentioned, Would love to know if there are some plans on moving to something like this. I know that might mean some breaking changes, but maybe thats ok at this stage.
Something new about this issue?
This would be great. Quite a lot of extra working writing unit tests I've discovered, and also, Tinostarn's comment on ng2-redux.
Any plans to implement?
In current implementation data models highly coupled with data storage. I think it will be better if we will use POJO augmented with decorators for data models. I.e. all methods that change data in underlying storage (currently,
save()
) should be moved fromJsonApiModel
toJsonApiDataStore
.Typical interaction with data storage can look like:
This approach have following advantages:
JsonApiDataStorage
. It can be easily created and tested.