Replies: 11 comments 2 replies
-
For clarity: All we need is to pass a parameter in to, say, |
Beta Was this translation helpful? Give feedback.
-
@wbhob, I have the same use cases with you, and I am working on the documentation and PR of those issues, for the |
Beta Was this translation helpful? Give feedback.
-
@JiaLiPassion, this is #1944 right? |
Beta Was this translation helpful? Give feedback.
-
@timdeschryver. #1944 is another use case. @wbhob 's use cases are.
#1944 resolved another use case, which is we may have multiple backend endpoints return the similar data, such as |
Beta Was this translation helpful? Give feedback.
-
Ok, thanks for clarifying this. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the help guys! I'll keep an eye out for this issue, as this would help a lot with our development. |
Beta Was this translation helpful? Give feedback.
-
@JiaLiPassion Is there any workaround or updates on nested data? Could you recommend how to deal with sitaution, where we have nested data from server? |
Beta Was this translation helpful? Give feedback.
-
There's a hacky way using
StackblitzThis begs the natural question... @wardbell should
This way someone can call a get request with whatever url they like and change state in a manner of their choosing by mapping to an Would require following changes: New Entity Cache Actions Implementations in EntityCacheEffects EntityCacheDataService. Can't find anything else... Happy to do a PR As an aside, do you have a UML diagram / fuller architecture diagram for ngrx/data? |
Beta Was this translation helpful? Give feedback.
-
If someone still wants to open a PR for this, feel free |
Beta Was this translation helpful? Give feedback.
-
@brandonroberts Would love to contribute. How can I get started? Does the following make sense? My initial thought is to simply support Angular HTTP Client's new "context" token for HTTP interceptor feature when calling ANY of the side-effect actions in EntityCollectionService, i.e. getAll, getWithQuery, getByKey, add, update, delete, upsert. I feel that this approach is highly scalable because the responsibility of constructing the API URL is delegated to the user (developer) himself. Shall I get started on this approach? |
Beta Was this translation helpful? Give feedback.
-
Hi @brandonroberts et al, I found I had some similar requirements, at least for the pagination aspects. Have created a pull request #3664 which adds support for passing http query parameters and/or http headers to api requests via angular's |
Beta Was this translation helpful? Give feedback.
-
Other information:
Many apps have relational data, as well as child structures, and I'm surprised an issue hasn't been opened about this before. Essentially, our use case is as follows.
We have a base object, say "vendors", which have products and events. Managing the vendors with @ngrx/data is relatively simple, but as soon as I try to write a data wrapper for events or products, type-checking prevents me from doing so.
In other words, vendors can be fetched from
/api/vendors
, but getting vendor products requires passing a vendor id, i.e./api/vendors/:vendor_id/products
. There aren't any docs on this whatsoever, and, like I said, the built in types don't like this fairly common data structure at all.Similarly, there is no documentation on how to add peripheral data, like pagination. Other issues about this have said that ngrx/data doesn't care about your pagination, and that you can implement it yourself, which would be fine if there were some sort of sample app or demo or docs to base it on. But after hunting the internet, there don't seem to be any docs or demos on a sample implementation that we can base it on, just people saying "ngrx data lets you do it yourself!".
I would be willing to submit a PR for the docs ❤️
[X] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No
Beta Was this translation helpful? Give feedback.
All reactions