snapshots method

Observable<DocumentData?> snapshots()

Returns a stream that emits a DocumentReference with the latest data from the server or null if the document is deleted or does not exist on the server.

Implementation

Observable<DocumentData?> snapshots() => _queryBuilderFactory
        .getForDocument(squidDocId)
        .dereference()
        .snapshots()
        .map((results) {
      assert(results.length <= 1,
          'Got more than one doc for the same id: $squidDocId');
      return results.firstOrNull;
    });