Currently, it's pretty unclear how to get @ngrx/data to replace the entity cache for various operations. I have an API endpoint that exposes /resource with for example an optional _search_ parameter, and it's unclear to me how to have theEntityCollectionService.getWithQuery` method result in the entities in the store simply being replaced, as the filtering is done server-side. There is the confusingly named Change Tracking but it's for local state changes.
What I would like to see is
1) Improved documentation or a how-to to replace default classes so replacing in the store is default behaviour.
2) A way to toggle the default merging of local and server-side collections by replacing local with remote outright.
Currently, the only solution I can see is overriding EntityCollectionBase.getWithQuery with a derived class that calls super.getWithQuery, but not before super.clearCache(), but this would have to be done for every service method.
P.S. I am using @ngrx/data for its boilerplate removing of actions, reducers, and selectors, but I currently have no need for change tracking and/or its caching behaviour.
Currently, it's pretty unclear how to get @ngrx/data to replace the entity cache for various operations. I have an API endpoint that exposes
/resource
with for example an optional_search_ parameter, and it's unclear to me how to have the
EntityCollectionService.getWithQuery` method result in the entities in the store simply being replaced, as the filtering is done server-side. There is the confusingly named Change Tracking but it's for local state changes.What I would like to see is 1) Improved documentation or a how-to to replace default classes so replacing in the store is default behaviour. 2) A way to toggle the default merging of local and server-side collections by replacing local with remote outright.
Currently, the only solution I can see is overriding
EntityCollectionBase.getWithQuery
with a derived class that callssuper.getWithQuery
, but not beforesuper.clearCache()
, but this would have to be done for every service method.P.S. I am using @ngrx/data for its boilerplate removing of actions, reducers, and selectors, but I currently have no need for change tracking and/or its caching behaviour.