Replies: 1 comment 1 reply
-
What do you mean? Can you please provide a minimal stackblitz example of what you're trying to do? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In a React app, I'm using
useObservable
to subscribe tofoosDataSource.data$()
. A simple example of this is:This works well when my service does something like
and repository does
However, I would also like to be able to track the status of request that use a key like
.trackRequestStatus({key: foo.id})
. In this case, I'm not sure what the best practice would be given that the key also needs to be passed to the data$() function likeconst [fooData] = useObservable(foosDataSource.data$({key: someId}));
. This would work for subscribing to an individual item's data, but I need to be able to track an unknown amount of items.Given the following:
is there a mechanism or best practice to subscribe to this data source for all possible keys that could be passed in to
.data$
?In other words, I would like to be able to update individual entities for this dynamic data source, but to have a single subscription that tells me when any of them are loading.
I know I can also use selectRequestStatus to do:
But I'm faced with the same problem here. If I update individual entities in the store, I'm not clear on how I could have a single subscription to show those status changes.
Beta Was this translation helpful? Give feedback.
All reactions