ViewModel constructor

ViewModel({
  1. String? errorMessage,
  2. ViewStatus status = ViewStatus.loading,
  3. Iterable<IObservable<BaseEvent>>? changes,
})

Implementation

ViewModel(
    {String? errorMessage,
    ViewStatus status = ViewStatus.loading,
    Iterable<IObservable<BaseEvent>>? changes}) {
  lastEvent = ViewChangedEvent(
    status: status,
    errorMessage: errorMessage,
    changes: changes ?? [],
  );
  eventSubject.stream.doOnData((event) => hasChanges = true);
}