watchModel method

  1. @override
Stream<PublishModel> watchModel(
  1. PublishSource source
)
override

The project's publish model, now and on every change.

Implementation

@override
Stream<PublishModel> watchModel(PublishSource source) async* {
  final t = await _target(source);
  yield* firestore
      .doc(t.source.modelPath(t.projectId))
      .snapshots()
      .where((s) => s.exists && (s.data()?.isNotEmpty ?? false))
      .map((s) => _model(s, t.projectId, t.source));
}