Skip to content

Commit 23f30c2

Browse files
committed
Observable Query.findStream() avoid offset and limit deprecated params
1 parent e6e6690 commit 23f30c2

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/src/observable.dart

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,15 @@ extension Streamable<T> on Query<T> {
7575
};
7676
}
7777

78-
Stream<List<T>> findStream({int offset = 0, int limit = 0}) {
78+
Stream<List<T>> findStream(
79+
{@Deprecated('Use offset() instead') int offset = 0,
80+
@Deprecated('Use limit() instead') int limit = 0}) {
7981
_setup();
80-
return _Observable.controller.stream
81-
.where((e) => e == entityId)
82-
.map((_) => find(offset: offset, limit: limit));
82+
return _Observable.controller.stream.where((e) => e == entityId).map((_) {
83+
if (offset != 0) this.offset(offset);
84+
if (limit != 0) this.limit(limit);
85+
return find();
86+
});
8387
}
8488

8589
/// Use this for Query Property

0 commit comments

Comments
 (0)