@rljson/db 0.0.17 → 0.0.19
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/dist/connector/connector.d.ts +2 -0
- package/dist/db.js +5 -1
- package/dist/db.js.map +1 -1
- package/package.json +1 -1
|
@@ -11,6 +11,7 @@ export declare class Connector {
|
|
|
11
11
|
private _callbacks;
|
|
12
12
|
private _conflictCallbacks;
|
|
13
13
|
private _missedRef;
|
|
14
|
+
private _lastSentRef;
|
|
14
15
|
private _isListening;
|
|
15
16
|
private _sentRefsCurrent;
|
|
16
17
|
private _sentRefsPrevious;
|
|
@@ -103,4 +104,5 @@ export declare class Connector {
|
|
|
103
104
|
get route(): Route;
|
|
104
105
|
get origin(): string;
|
|
105
106
|
get isListening(): boolean;
|
|
107
|
+
get lastSentRef(): string | null;
|
|
106
108
|
}
|
package/dist/db.js
CHANGED
|
@@ -24,6 +24,7 @@ class Connector {
|
|
|
24
24
|
_callbacks = [];
|
|
25
25
|
_conflictCallbacks = [];
|
|
26
26
|
_missedRef = null;
|
|
27
|
+
_lastSentRef = null;
|
|
27
28
|
_isListening = false;
|
|
28
29
|
// Two-generation dedup sets — bounded memory
|
|
29
30
|
_sentRefsCurrent = /* @__PURE__ */ new Set();
|
|
@@ -47,7 +48,6 @@ class Connector {
|
|
|
47
48
|
send(ref) {
|
|
48
49
|
if (this._hasSentRef(ref) || this._hasReceivedRef(ref)) return;
|
|
49
50
|
this._addSentRef(ref);
|
|
50
|
-
this._missedRef = null;
|
|
51
51
|
const payload = {
|
|
52
52
|
o: this._origin,
|
|
53
53
|
r: ref
|
|
@@ -62,6 +62,7 @@ class Connector {
|
|
|
62
62
|
payload.p = [...this._lastPredecessors];
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
+
this._lastSentRef = ref;
|
|
65
66
|
this.socket.emit(this._events.ref, payload);
|
|
66
67
|
}
|
|
67
68
|
// ...........................................................................
|
|
@@ -299,6 +300,9 @@ class Connector {
|
|
|
299
300
|
get isListening() {
|
|
300
301
|
return this._isListening;
|
|
301
302
|
}
|
|
303
|
+
get lastSentRef() {
|
|
304
|
+
return this._lastSentRef;
|
|
305
|
+
}
|
|
302
306
|
}
|
|
303
307
|
class BaseController {
|
|
304
308
|
constructor(_core, _tableKey) {
|