entropic-bond 1.51.0 → 1.51.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.
|
@@ -59,6 +59,10 @@ interface DocumentChange {
|
|
|
59
59
|
after: DocumentObject;
|
|
60
60
|
}
|
|
61
61
|
export type DocumentChangeListerner = (change: DocumentChange) => void;
|
|
62
|
+
export interface DocumentChangeListernerHandler {
|
|
63
|
+
uninstall: DocumentListenerUninstaller;
|
|
64
|
+
nativeHandler: unknown;
|
|
65
|
+
}
|
|
62
66
|
/**
|
|
63
67
|
* The data source interface.
|
|
64
68
|
* It defines the methods that must be implemented by a data source
|
|
@@ -67,16 +71,17 @@ export type DocumentChangeListerner = (change: DocumentChange) => void;
|
|
|
67
71
|
* A data source is used by the store to retrieve and save data.
|
|
68
72
|
*/
|
|
69
73
|
export declare abstract class DataSource {
|
|
70
|
-
installReferencePersistentPropsUpdaters(onUpdate?: (doc: Persistent) => void, throwOnNonImplementedListener?: boolean):
|
|
74
|
+
installReferencePersistentPropsUpdaters(onUpdate?: (doc: Persistent) => void, throwOnNonImplementedListener?: boolean): DocumentChangeListernerHandler[];
|
|
71
75
|
/**
|
|
72
76
|
* Installs a document change listener
|
|
73
77
|
* Implement the required logic to install a listener that will be called
|
|
74
78
|
* when a document is changed in your concrete the data source
|
|
75
|
-
* @param
|
|
76
|
-
* @param listener the
|
|
77
|
-
* @returns a function that uninstalls the listener
|
|
79
|
+
* @param prop the property that has a reference to a persistent object
|
|
80
|
+
* @param listener the listener to be called when a document is changed
|
|
81
|
+
* @returns a function that uninstalls the listener. If the returned value is undefined
|
|
82
|
+
* the method documentChangeListerner has not been implemented in the concrete data source
|
|
78
83
|
*/
|
|
79
|
-
protected
|
|
84
|
+
protected subscribeToDocumentChangeListerner(prop: PersistentProperty, listener: DocumentChangeListerner): DocumentChangeListernerHandler | undefined;
|
|
80
85
|
/**
|
|
81
86
|
* Retrieves a document by id
|
|
82
87
|
* Implement the required logic to retrieve a document by id from your concrete
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DataSource, DocumentChangeListerner,
|
|
1
|
+
import { DataSource, DocumentChangeListerner, DocumentChangeListernerHandler, DocumentObject, QueryObject } from './data-source';
|
|
2
2
|
import { Collections, Persistent, PersistentObject, PersistentProperty } from '../persistent/persistent';
|
|
3
3
|
|
|
4
4
|
export interface JsonRawData {
|
|
@@ -52,7 +52,7 @@ export declare class JsonDataSource extends DataSource {
|
|
|
52
52
|
wait(): Promise<any[]>;
|
|
53
53
|
private incCursor;
|
|
54
54
|
simulateError(error: string | ErrorOnOperation | undefined): this;
|
|
55
|
-
protected
|
|
55
|
+
protected subscribeToDocumentChangeListerner(prop: PersistentProperty, listener: DocumentChangeListerner): DocumentChangeListernerHandler | undefined;
|
|
56
56
|
private notifyChange;
|
|
57
57
|
private decCursor;
|
|
58
58
|
private queryProcessor;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "entropic-bond",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.51.
|
|
4
|
+
"version": "1.51.2",
|
|
5
5
|
"description": "Tidy up your messy components",
|
|
6
6
|
"main": "./lib/entropic-bond.umd.cjs",
|
|
7
7
|
"module": "./lib/entropic-bond.js",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"typedoc": "^0.25.13",
|
|
65
65
|
"typedoc-plugin-markdown": "^3.17.1",
|
|
66
66
|
"typescript": "^5.4.5",
|
|
67
|
-
"vite-plugin-dts": "^3.8.
|
|
67
|
+
"vite-plugin-dts": "^3.8.3",
|
|
68
68
|
"vitest": "^1.5.0"
|
|
69
69
|
},
|
|
70
70
|
"dependencies": {
|