[docs]: StreamViewModel -> How to check if data is available or not
Closed this issue · 1 comments
Abhijit-Revamp commented
Describe the missing piece of documentation
Two requests:
-
How to check if the stream has data. I am fetching data from Firestore / other backend databases. At times the streams take a while to react (based on conditions). Based on the conditions (example: isRecordDeleted=true), the steam may not return anything till some backend operation is performed. Like OnError etc, is there an option to detect if steam has data
-
Is there a way to pre-process data before the Reactive view responds. Or at least override "onData" so that some additional action can be taken. Earlier onData was overridable - now its not.
FilledStacks commented
Hey,
- You can use the hasData property on the viewModel to check if there's data
- Yes, you can still override all of the StreamViewModel methods