Multiple request/cache updates within single store update #78
-
Assuming I have array-like runtime composed collections with request keys and request cache keys respectively how would I build the I feel like something's missing here: I can skip request if I have this request key cached, but in fact I don't really care about request key because I want to skip the request if the data is cached; so as soon as requests can differ (I can request either just one entity or a bunch of entities at once) it takes something special to fulfill the case. So lets imagine I have Like some operator |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
If you want to update multiple requests once, you can do: store.update(
state => {
return {
...state:
requestsStatus: [ 'request1', 'request2', 'request3' ].reduce( build the object here )
}
}
) |
Beta Was this translation helpful? Give feedback.
-
https://ngneat.github.io/elf/docs/features/requests/requests-status#updaterequestsstatus |
Beta Was this translation helpful? Give feedback.
https://ngneat.github.io/elf/docs/features/requests/requests-status#updaterequestsstatus