@livequery/client 2.0.11 → 2.0.15

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.
@@ -176,7 +176,7 @@ export class CollectionObservable extends BehaviorSubject {
176
176
  this.#IdMap.clear();
177
177
  state.items.map((item, index) => this.#IdMap.set(item.id, index));
178
178
  }
179
- if (state.paging.count) {
179
+ if (state.paging?.count) {
180
180
  const d = state.items.length - state.paging.count.current;
181
181
  state.paging.count.current = state.items.length;
182
182
  state.paging.count.total += d;
@@ -202,8 +202,8 @@ export class CollectionObservable extends BehaviorSubject {
202
202
  prev: stream.some(s => s.data?.paging?.has?.prev)
203
203
  },
204
204
  page: {
205
- current: Math.min(...stream.map(s => s.data?.paging?.page.current || 0)),
206
- total: Math.max(...stream.map(s => s.data?.paging?.page.total || 0))
205
+ current: Math.min(...stream.map(s => s.data?.paging?.page?.current || 0)),
206
+ total: Math.max(...stream.map(s => s.data?.paging?.page?.total || 0))
207
207
  }
208
208
  };
209
209
  }
@@ -242,7 +242,7 @@ export class CollectionObservable extends BehaviorSubject {
242
242
  const paging = this.#pages.get(ref);
243
243
  if (!paging)
244
244
  return true;
245
- return loading == 'forward' ? paging.has.next : paging.has.prev;
245
+ return loading == 'forward' ? paging.has?.next : paging.has?.prev;
246
246
  });
247
247
  const no_more_data = !flush && (remain_data_refs.length == 0 || this.getValue().loading);
248
248
  if (no_more_data)
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.11",
7
+ "version": "2.0.15",
8
8
  "description": "",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",