@livequery/client 2.0.25 → 2.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,6 +18,7 @@ export type SmartQueryItem<T> = T & {
18
18
  toJson: () => T;
19
19
  };
20
20
  export type CollectionStream<T extends LivequeryBaseEntity = LivequeryBaseEntity> = {
21
+ n: number;
21
22
  items: SmartQueryItem<T>[];
22
23
  paging: Partial<Paging>;
23
24
  loading?: LoadingIndicator;
@@ -15,6 +15,7 @@ export class CollectionObservable extends BehaviorSubject {
15
15
  }
16
16
  constructor(ref, collection_options) {
17
17
  super({
18
+ n: 0,
18
19
  items: [],
19
20
  loading: false,
20
21
  paging: {},
@@ -50,6 +51,7 @@ export class CollectionObservable extends BehaviorSubject {
50
51
  for (const { data, error, code, message, } of stream) {
51
52
  if (from == 'request') {
52
53
  state.loading = false;
54
+ state.n = state.n + 1;
53
55
  }
54
56
  // Error & paging
55
57
  if (error) {
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "repository": {
5
5
  "url": "https://github.com/livequery/client"
6
6
  },
7
- "version": "2.0.25",
7
+ "version": "2.0.30",
8
8
  "description": "",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",