@livequery/client 2.0.0 → 2.0.2
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.
- package/build/Collection.d.ts +1 -1
- package/build/Collection.js +7 -3
- package/package.json +1 -1
package/build/Collection.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type SmartQueryItem<T> = T & {
|
|
|
13
13
|
__update: (data: Partial<T>) => any;
|
|
14
14
|
__updating: boolean;
|
|
15
15
|
__adding: boolean;
|
|
16
|
-
__trigger: <R extends {}>(name: string, payload?: any) => Promise<Response<R>>;
|
|
16
|
+
__trigger: <R extends {}>(name: string, payload?: any, query?: any) => Promise<Response<R>>;
|
|
17
17
|
__ref: string;
|
|
18
18
|
};
|
|
19
19
|
export type CollectionStream<T extends LivequeryBaseEntity = LivequeryBaseEntity> = {
|
package/build/Collection.js
CHANGED
|
@@ -104,7 +104,7 @@ export class CollectionObservable extends Observable {
|
|
|
104
104
|
__updating: false,
|
|
105
105
|
__removing: false,
|
|
106
106
|
__remove: () => this.remove(payload?.id),
|
|
107
|
-
__trigger: (name, input) => this.trigger(name, input, payload?.id),
|
|
107
|
+
__trigger: (name, input = undefined, query) => this.trigger(name, input, payload?.id, query),
|
|
108
108
|
__update: (input) => this.update({ ...input, id: payload?.id }),
|
|
109
109
|
__ref: change.ref
|
|
110
110
|
};
|
|
@@ -211,7 +211,11 @@ export class CollectionObservable extends Observable {
|
|
|
211
211
|
const state = {
|
|
212
212
|
...this.$.getValue(),
|
|
213
213
|
items: flush ? [] : this.$.getValue().items,
|
|
214
|
-
loading
|
|
214
|
+
loading,
|
|
215
|
+
options: {
|
|
216
|
+
...this.$.getValue().options || {},
|
|
217
|
+
...options
|
|
218
|
+
}
|
|
215
219
|
};
|
|
216
220
|
if (flush) {
|
|
217
221
|
this.#pages.clear();
|
|
@@ -351,6 +355,6 @@ export class CollectionObservable extends Observable {
|
|
|
351
355
|
const { ref } = this.#find_ref_by_id(trigger_document_id);
|
|
352
356
|
if (!ref)
|
|
353
357
|
throw new Error('INVAILD_REF');
|
|
354
|
-
return await this.collection_options.transporter.trigger(ref, name,
|
|
358
|
+
return await this.collection_options.transporter.trigger(ref, name, payload, query);
|
|
355
359
|
}
|
|
356
360
|
}
|