@livequery/client 2.0.22 → 2.0.23

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.
@@ -15,6 +15,7 @@ export type SmartQueryItem<T> = T & {
15
15
  __adding: boolean;
16
16
  __trigger: <R extends {}>(name: string, payload?: any, query?: any) => Promise<Response<R>>;
17
17
  __ref: string;
18
+ toJson: () => T;
18
19
  };
19
20
  export type CollectionStream<T extends LivequeryBaseEntity = LivequeryBaseEntity> = {
20
21
  items: SmartQueryItem<T>[];
@@ -114,7 +114,8 @@ export class CollectionObservable extends BehaviorSubject {
114
114
  __remove: () => this.remove(payload?.id),
115
115
  __trigger: (name, input = undefined, query) => this.trigger(name, input, payload?.id, query),
116
116
  __update: (input) => this.update({ ...input, id: payload?.id }),
117
- __ref: change.ref
117
+ __ref: change.ref,
118
+ toJson: () => payload
118
119
  };
119
120
  direction == 'forward' ? state.items.push(item) : state.items.unshift(item);
120
121
  actions.reindex = true;
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.22",
7
+ "version": "2.0.23",
8
8
  "description": "",
9
9
  "main": "build/index.js",
10
10
  "types": "build/index.d.ts",