Stacked-Org/stacked

[docs]: StreamViewModel -> How to check if data is available or not

Closed this issue · 1 comments

Describe the missing piece of documentation

Two requests:

  1. 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

  2. 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.

Hey,

  1. You can use the hasData property on the viewModel to check if there's data
  2. Yes, you can still override all of the StreamViewModel methods