We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents dbf77f8 + 321cfd7 commit c7a2352Copy full SHA for c7a2352
src/firestore-query.js
@@ -110,13 +110,19 @@ MockFirestoreQuery.prototype.get = function () {
110
};
111
112
MockFirestoreQuery.prototype.stream = function () {
113
- var stream = new Stream();
+ var stream = new Stream.Transform({
114
+ objectMode: true,
115
+ transform: function (chunk, encoding, done) {
116
+ this.push(chunk);
117
+ done();
118
+ }
119
+ });
120
121
this.get().then(function (snapshots) {
122
snapshots.forEach(function (snapshot) {
- stream.emit('data', snapshot);
123
+ stream.write(snapshot);
124
});
- stream.emit('end');
125
+ stream.end();
126
127
128
return stream;
0 commit comments