@bringg/dashboard-sdk 10.2.3-pre.1 → 10.2.3-pre.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/dist/Customer/v2/customers-api.d.ts +0 -8
- package/dist/Customer/v2/customers-api.js +0 -10
- package/dist/Customer/v2/customers-api.js.map +1 -1
- package/dist/Data/data-store-with-signals.d.ts +0 -6
- package/dist/Data/data-store-with-signals.js +0 -8
- package/dist/Data/data-store-with-signals.js.map +1 -1
- package/dist/Data/item-change-signals.d.ts +4 -10
- package/dist/Data/item-change-signals.js +45 -67
- package/dist/Data/item-change-signals.js.map +1 -1
- package/dist/bringg-dashboard-sdk-cjs2.js +46 -86
- package/dist/bringg-dashboard-sdk-cjs2.js.map +1 -1
- package/dist/bringg-dashboard-sdk.js +4 -4
- package/dist/bringg-dashboard-sdk.min.js +1 -1
- package/dist/bringg-dashboard-sdk.min.js.map +1 -1
- package/package.json +1 -1
|
@@ -19,14 +19,6 @@ export default class CustomersApi {
|
|
|
19
19
|
add(customer: Customer): MappedStorableItem<Customer>;
|
|
20
20
|
getAll(): Customer[];
|
|
21
21
|
get(id: number): Customer;
|
|
22
|
-
/**
|
|
23
|
-
* A number that grows each time the customer changes. The customer object stays the same after an update,
|
|
24
|
-
* so an observer render puts this value in its memo dependencies to rebuild what it derives from the customer.
|
|
25
|
-
* A computed that returns the customer object must also return this value, or MobX passes no change on.
|
|
26
|
-
* @param id - Customer id
|
|
27
|
-
* @returns The customer's change version (meaningful inside an observer render)
|
|
28
|
-
*/
|
|
29
|
-
getVersion(id: number): number;
|
|
30
22
|
loadAll(params?: GetAllRequest, options?: DataOptions): Promise<any>;
|
|
31
23
|
loadMany(ids: number[], options?: DataOptions): Promise<Customer[]>;
|
|
32
24
|
load(id: any, options?: DataOptions): Promise<Customer>;
|
|
@@ -101,16 +101,6 @@ var CustomersApi = /** @class */ (function () {
|
|
|
101
101
|
CustomersApi.prototype.get = function (id) {
|
|
102
102
|
return this.customersStore.get(id);
|
|
103
103
|
};
|
|
104
|
-
/**
|
|
105
|
-
* A number that grows each time the customer changes. The customer object stays the same after an update,
|
|
106
|
-
* so an observer render puts this value in its memo dependencies to rebuild what it derives from the customer.
|
|
107
|
-
* A computed that returns the customer object must also return this value, or MobX passes no change on.
|
|
108
|
-
* @param id - Customer id
|
|
109
|
-
* @returns The customer's change version (meaningful inside an observer render)
|
|
110
|
-
*/
|
|
111
|
-
CustomersApi.prototype.getVersion = function (id) {
|
|
112
|
-
return this.customersStore.getVersion(id);
|
|
113
|
-
};
|
|
114
104
|
CustomersApi.prototype.loadAll = function (params, options) {
|
|
115
105
|
var _this = this;
|
|
116
106
|
if (options === void 0) { options = data_entity_1.DEFAULT_OPTIONS; }
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customers-api.js","sourceRoot":"","sources":["../../../src/Customer/v2/customers-api.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,kDAAuB;AAEvB,+FAAsE;AACtE,wDAAsD;AACtD,+GAAuF;AAEvF,iDAAqF;AAErF,sFAA8D;AAC9D,uDAAqD;AACrD,sDAAiH;AACjH,0EAAmD;AAEnD;IAOC,sBAAY,OAAgB;QAA5B,iBAsBC;QArBA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,cAAc,GAAG,IAAI,iCAAoB,CAAW,gBAAgB,CAAC,CAAC;QAC3E,IAAI,CAAC,gBAAgB,GAAG,IAAI,2BAAgB,CAAC,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,mBAAmB,GAAG,IAAI,+BAAmB,CAAC,IAAI,CAAC,cAAc,EAAE,UAAA,QAAQ;YAC/E,OAAA,0BAAW,CAAC,iBAAiB,CAAC,KAAI,CAAC,cAAc,EAAE,QAAQ,CAAC;QAA5D,CAA4D,CAC5D,CAAC;QAEF,IAAI,CAAC,6BAA6B,GAAG,IAA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E,CAAC,EAA9B,CAA8B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACjG,CAAC;IAEM,2BAAI,GAAX,UAAY,MAAmB;QAC9B,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC;IAEM,+BAAQ,GAAf,UAAgB,EAAU,EAAE,IAAY;QACvC,OAAO,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;IACjD,CAAC;IAEM,oCAAa,GAApB,UAAqB,EAAU;QAC9B,OAAO,IAAI,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IAEM,6BAAM,GAAb,UAAc,YAAsB;QAApC,iBAEC;QADA,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,QAAQ,EAAE,cAAM,OAAA,KAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,YAAY,CAAC,EAA1C,CAA0C,CAAC,CAAC;IACpG,CAAC;IAEM,6BAAM,GAAb,UAAc,YAAsB;QAApC,iBAEC;QADA,OAAO,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,QAAQ,EAAE,cAAM,OAAA,KAAI,CAAC,gBAAgB,CAAC,MAAM,CAAC,YAAY,CAAC,EAA1C,CAA0C,CAAC,CAAC;IACpG,CAAC;IACF,mBAAC;AAAD,CAAC,AAjID,IAiIC;;AAED,SAAS,kCAAkC,CAAC,OAAgB;;IAC3D,OAAO,OAAO,CAAC,MAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,aAAa,0CAAG,iDAA+B,CAAC,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -19,12 +19,6 @@ export default class DataStoreWithSignals<TEntity extends DataEntity> implements
|
|
|
19
19
|
/** The inner items by id. Reading it subscribes nothing: use it in writers, never in views. */
|
|
20
20
|
get allItems(): Record<number, TEntity>;
|
|
21
21
|
get(id: number): TEntity;
|
|
22
|
-
/**
|
|
23
|
-
* A number that grows each time the item changes. Use it in memo dependencies of an observer render, because the
|
|
24
|
-
* item object itself stays the same after an update. A computed that returns the item object must also return this
|
|
25
|
-
* value, or MobX sees the same object and passes no change on.
|
|
26
|
-
*/
|
|
27
|
-
getVersion(id: number): number;
|
|
28
22
|
getAll(): TEntity[];
|
|
29
23
|
getGroup(group: string, groupValue: GroupValue): TEntity[];
|
|
30
24
|
isGroupInitialized(groupType: string, groupValue: GroupValue): boolean;
|
|
@@ -31,14 +31,6 @@ var DataStoreWithSignals = /** @class */ (function () {
|
|
|
31
31
|
this.signals.observe(id);
|
|
32
32
|
return this.store.get(id);
|
|
33
33
|
};
|
|
34
|
-
/**
|
|
35
|
-
* A number that grows each time the item changes. Use it in memo dependencies of an observer render, because the
|
|
36
|
-
* item object itself stays the same after an update. A computed that returns the item object must also return this
|
|
37
|
-
* value, or MobX sees the same object and passes no change on.
|
|
38
|
-
*/
|
|
39
|
-
DataStoreWithSignals.prototype.getVersion = function (id) {
|
|
40
|
-
return this.signals.version(id);
|
|
41
|
-
};
|
|
42
34
|
DataStoreWithSignals.prototype.getAll = function () {
|
|
43
35
|
this.signals.observeAll();
|
|
44
36
|
return this.store.getAll();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data-store-with-signals.js","sourceRoot":"","sources":["../../src/Data/data-store-with-signals.ts"],"names":[],"mappings":";;;;;AACA,6DAAsC;AACtC,8EAAsD;AAKtD;;;GAGG;AACH;IAIC;;;OAGG;IACH,8BAAY,OAAe,EAAE,YAAyC;QAAzC,6BAAA,EAAA,iBAAyC;QACrE,IAAI,CAAC,KAAK,GAAG,IAAI,oBAAS,CAAU,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC;QACrE,IAAI,CAAC,OAAO,GAAG,IAAI,6BAAiB,CAAC,OAAO,CAAC,CAAC;IAC/C,CAAC;IAGD,sBAAW,0CAAQ;QADnB,+FAA+F;aAC/F;YACC,OAAO,IA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CAAC,OAAO,CAAC,aAAa,CAAC;QACnC,CAAC;;;OAAA;IACF,2BAAC;AAAD,CAAC,AArED,IAqEC;;AAED,yDAAyD;AACzD,SAAS,SAAS,CAA6B,IAAiC;IAC/E,OAAO,CAAC,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC;AACxD,CAAC"}
|
|
@@ -5,29 +5,23 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export default class ItemChangeSignals {
|
|
7
7
|
private readonly storeId;
|
|
8
|
-
private readonly
|
|
8
|
+
private readonly atoms;
|
|
9
9
|
private probe;
|
|
10
10
|
private anyChange;
|
|
11
|
-
private seq;
|
|
12
11
|
/** @param storeId - Store name for the MobX atom names (devtools and spy only), for example `customersStore`. */
|
|
13
12
|
constructor(storeId: string);
|
|
14
13
|
/** Reports a read of `id`. Subscribes the current reaction to changes of that id. */
|
|
15
14
|
observe(id: number): void;
|
|
16
15
|
/** Reports a read of the whole store (list readers). Subscribes the current reaction to every change. */
|
|
17
16
|
observeAll(): void;
|
|
18
|
-
/**
|
|
19
|
-
* Version of `id`: grows on every signal of that id. Meaningful only inside a reaction (it subscribes it);
|
|
20
|
-
* outside a reaction it returns the store-wide counter, so a memo keyed by it is never stale.
|
|
21
|
-
*/
|
|
22
|
-
version(id: number): number;
|
|
23
17
|
/** Reports a change of each id, in one MobX action, then fires `anyChange` once. */
|
|
24
18
|
notify(ids: number[]): void;
|
|
25
19
|
/** Reports a change of every observed id (a store reload or a bulk remove). */
|
|
26
20
|
notifyAllObserved(): void;
|
|
27
|
-
/** Number of live id
|
|
21
|
+
/** Number of live id atoms. For tests only. */
|
|
28
22
|
get observedCount(): number;
|
|
29
|
-
private
|
|
30
|
-
private
|
|
23
|
+
private hasBeenRead;
|
|
24
|
+
private createAtom;
|
|
31
25
|
private getProbe;
|
|
32
26
|
private getAnyChange;
|
|
33
27
|
}
|
|
@@ -22,13 +22,33 @@ var ItemChangeSignals = /** @class */ (function () {
|
|
|
22
22
|
function ItemChangeSignals(storeId) {
|
|
23
23
|
this.storeId = storeId;
|
|
24
24
|
// Keyed by Number(id): stores accept number-like string ids too.
|
|
25
|
-
this.
|
|
26
|
-
// Store-wide clock: a re-created entry starts here, so an equal version always means no change since.
|
|
27
|
-
this.seq = 0;
|
|
25
|
+
this.atoms = new Map();
|
|
28
26
|
}
|
|
29
27
|
/** Reports a read of `id`. Subscribes the current reaction to changes of that id. */
|
|
30
28
|
ItemChangeSignals.prototype.observe = function (id) {
|
|
31
|
-
|
|
29
|
+
if (id === undefined || id === null || !getMobx()) {
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
id = Number(id);
|
|
33
|
+
// Cheap filter, the probe never fires: false for a read outside any derivation, so no per-id atom is created on the
|
|
34
|
+
// hot path. Such a read reports only the shared `anyChange` atom.
|
|
35
|
+
if (!this.getProbe().reportObserved()) {
|
|
36
|
+
this.getAnyChange().reportObserved();
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
var atom = this.atoms.get(id);
|
|
40
|
+
var isNew = !atom;
|
|
41
|
+
if (isNew) {
|
|
42
|
+
atom = this.createAtom(id);
|
|
43
|
+
}
|
|
44
|
+
// Exact check: false for a new atom read by a computed evaluated inside an action (no reaction behind it).
|
|
45
|
+
// MobX never calls the unobserve callback of such an atom, so it would leak; watch `anyChange` instead.
|
|
46
|
+
if (!atom.reportObserved()) {
|
|
47
|
+
if (isNew) {
|
|
48
|
+
this.atoms.delete(id);
|
|
49
|
+
}
|
|
50
|
+
this.getAnyChange().reportObserved();
|
|
51
|
+
}
|
|
32
52
|
};
|
|
33
53
|
/** Reports a read of the whole store (list readers). Subscribes the current reaction to every change. */
|
|
34
54
|
ItemChangeSignals.prototype.observeAll = function () {
|
|
@@ -36,36 +56,19 @@ var ItemChangeSignals = /** @class */ (function () {
|
|
|
36
56
|
this.getAnyChange().reportObserved();
|
|
37
57
|
}
|
|
38
58
|
};
|
|
39
|
-
/**
|
|
40
|
-
* Version of `id`: grows on every signal of that id. Meaningful only inside a reaction (it subscribes it);
|
|
41
|
-
* outside a reaction it returns the store-wide counter, so a memo keyed by it is never stale.
|
|
42
|
-
*/
|
|
43
|
-
ItemChangeSignals.prototype.version = function (id) {
|
|
44
|
-
var _a, _b;
|
|
45
|
-
this.track(id);
|
|
46
|
-
return (_b = (_a = this.entries.get(Number(id))) === null || _a === void 0 ? void 0 : _a.version) !== null && _b !== void 0 ? _b : this.seq;
|
|
47
|
-
};
|
|
48
59
|
/** Reports a change of each id, in one MobX action, then fires `anyChange` once. */
|
|
49
60
|
ItemChangeSignals.prototype.notify = function (ids) {
|
|
50
61
|
var _this = this;
|
|
51
|
-
if (!ids.length) {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
this.seq++;
|
|
55
|
-
if (!this.anyChange && !this.entries.size) {
|
|
56
|
-
// Nothing was ever observed: no reaction to tell.
|
|
62
|
+
if (!ids.length || !this.hasBeenRead()) {
|
|
57
63
|
return;
|
|
58
64
|
}
|
|
59
65
|
getMobx().runInAction(function () {
|
|
60
66
|
var e_1, _a;
|
|
67
|
+
var _b;
|
|
61
68
|
try {
|
|
62
69
|
for (var ids_1 = __values(ids), ids_1_1 = ids_1.next(); !ids_1_1.done; ids_1_1 = ids_1.next()) {
|
|
63
70
|
var id = ids_1_1.value;
|
|
64
|
-
|
|
65
|
-
if (entry) {
|
|
66
|
-
entry.version = _this.seq;
|
|
67
|
-
entry.atom.reportChanged();
|
|
68
|
-
}
|
|
71
|
+
(_b = _this.atoms.get(Number(id))) === null || _b === void 0 ? void 0 : _b.reportChanged();
|
|
69
72
|
}
|
|
70
73
|
}
|
|
71
74
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -81,17 +84,15 @@ var ItemChangeSignals = /** @class */ (function () {
|
|
|
81
84
|
/** Reports a change of every observed id (a store reload or a bulk remove). */
|
|
82
85
|
ItemChangeSignals.prototype.notifyAllObserved = function () {
|
|
83
86
|
var _this = this;
|
|
84
|
-
this.
|
|
85
|
-
if (!this.anyChange && !this.entries.size) {
|
|
87
|
+
if (!this.hasBeenRead()) {
|
|
86
88
|
return;
|
|
87
89
|
}
|
|
88
90
|
getMobx().runInAction(function () {
|
|
89
91
|
var e_2, _a;
|
|
90
92
|
try {
|
|
91
|
-
for (var _b = __values(_this.
|
|
92
|
-
var
|
|
93
|
-
|
|
94
|
-
entry.atom.reportChanged();
|
|
93
|
+
for (var _b = __values(_this.atoms.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
94
|
+
var atom = _c.value;
|
|
95
|
+
atom.reportChanged();
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -105,51 +106,28 @@ var ItemChangeSignals = /** @class */ (function () {
|
|
|
105
106
|
});
|
|
106
107
|
};
|
|
107
108
|
Object.defineProperty(ItemChangeSignals.prototype, "observedCount", {
|
|
108
|
-
/** Number of live id
|
|
109
|
+
/** Number of live id atoms. For tests only. */
|
|
109
110
|
get: function () {
|
|
110
|
-
return this.
|
|
111
|
+
return this.atoms.size;
|
|
111
112
|
},
|
|
112
113
|
enumerable: false,
|
|
113
114
|
configurable: true
|
|
114
115
|
});
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
id = Number(id);
|
|
120
|
-
// Cheap filter, the probe never fires: false for a read outside any derivation, so no atom is created on the hot path.
|
|
121
|
-
if (!this.getProbe().reportObserved()) {
|
|
122
|
-
this.getAnyChange().reportObserved();
|
|
123
|
-
return;
|
|
124
|
-
}
|
|
125
|
-
var entry = this.entries.get(id);
|
|
126
|
-
var isNew = !entry;
|
|
127
|
-
if (isNew) {
|
|
128
|
-
entry = this.createEntry(id);
|
|
129
|
-
}
|
|
130
|
-
// Exact check: false for a new atom read by a computed evaluated inside an action (no reaction behind it).
|
|
131
|
-
// MobX never calls the unobserve callback of such an atom, so the entry would leak; watch `anyChange` instead.
|
|
132
|
-
if (!entry.atom.reportObserved()) {
|
|
133
|
-
if (isNew) {
|
|
134
|
-
this.entries.delete(id);
|
|
135
|
-
}
|
|
136
|
-
this.getAnyChange().reportObserved();
|
|
137
|
-
}
|
|
116
|
+
// False until the first read: before it, no reaction can be watching.
|
|
117
|
+
ItemChangeSignals.prototype.hasBeenRead = function () {
|
|
118
|
+
return Boolean(this.anyChange) || this.atoms.size > 0;
|
|
138
119
|
};
|
|
139
|
-
ItemChangeSignals.prototype.
|
|
120
|
+
ItemChangeSignals.prototype.createAtom = function (id) {
|
|
140
121
|
var _this = this;
|
|
141
|
-
// The callback reads `
|
|
122
|
+
// The callback reads `atom` only when MobX calls it, at the end of a batch after the last observer left,
|
|
142
123
|
// never during `createAtom`.
|
|
143
|
-
var
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
};
|
|
151
|
-
this.entries.set(id, entry);
|
|
152
|
-
return entry;
|
|
124
|
+
var atom = getMobx().createAtom("".concat(this.storeId, ".item.").concat(id), undefined, function () {
|
|
125
|
+
if (_this.atoms.get(id) === atom) {
|
|
126
|
+
_this.atoms.delete(id);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
this.atoms.set(id, atom);
|
|
130
|
+
return atom;
|
|
153
131
|
};
|
|
154
132
|
ItemChangeSignals.prototype.getProbe = function () {
|
|
155
133
|
if (!this.probe) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"item-change-signals.js","sourceRoot":"","sources":["../../src/Data/item-change-signals.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAEA,4DAAmD;
|
|
1
|
+
{"version":3,"file":"item-change-signals.js","sourceRoot":"","sources":["../../src/Data/item-change-signals.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAEA,4DAAmD;AAEnD;;;;GAIG;AACH;IAMC,iHAAiH;IACjH,2BAA6B,OAAe;QA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,IAAI,EAAE;gBAChC,KAAI,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;aACtB;QACF,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC;IACb,CAAC;IAEO,oCAAQ,GAAhB;QACC,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;YAChB,IAAI,CAAC,KAAK,GAAG,OAAO,EAAE,CAAC,UAAU,CAAC,UAAG,IAAI,CAAC,OAAO,WAAQ,CAAC,CAAC;SAC3D;QAED,OAAO,IAAI,CAAC,KAAK,CAAC;IACnB,CAAC;IAEO,wCAAY,GAApB;QACC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACpB,IAAI,CAAC,SAAS,GAAG,OAAO,EAAE,CAAC,UAAU,CAAC,UAAG,IAAI,CAAC,OAAO,eAAY,CAAC,CAAC;SACnE;QAED,OAAO,IAAI,CAAC,SAAS,CAAC;IACvB,CAAC;IACF,wBAAC;AAAD,CAAC,AAvHD,IAuHC;;AAED,mHAAmH;AACnH,SAAS,OAAO;;IACf,OAAO,MAAA,IAAA,+BAAU,GAAE,0CAAE,IAAI,CAAC;AAC3B,CAAC"}
|
|
@@ -8420,16 +8420,6 @@ var CustomersApi = /** @class */ (function () {
|
|
|
8420
8420
|
CustomersApi.prototype.get = function (id) {
|
|
8421
8421
|
return this.customersStore.get(id);
|
|
8422
8422
|
};
|
|
8423
|
-
/**
|
|
8424
|
-
* A number that grows each time the customer changes. The customer object stays the same after an update,
|
|
8425
|
-
* so an observer render puts this value in its memo dependencies to rebuild what it derives from the customer.
|
|
8426
|
-
* A computed that returns the customer object must also return this value, or MobX passes no change on.
|
|
8427
|
-
* @param id - Customer id
|
|
8428
|
-
* @returns The customer's change version (meaningful inside an observer render)
|
|
8429
|
-
*/
|
|
8430
|
-
CustomersApi.prototype.getVersion = function (id) {
|
|
8431
|
-
return this.customersStore.getVersion(id);
|
|
8432
|
-
};
|
|
8433
8423
|
CustomersApi.prototype.loadAll = function (params, options) {
|
|
8434
8424
|
var _this = this;
|
|
8435
8425
|
if (options === void 0) { options = data_entity_1.DEFAULT_OPTIONS; }
|
|
@@ -9043,14 +9033,6 @@ var DataStoreWithSignals = /** @class */ (function () {
|
|
|
9043
9033
|
this.signals.observe(id);
|
|
9044
9034
|
return this.store.get(id);
|
|
9045
9035
|
};
|
|
9046
|
-
/**
|
|
9047
|
-
* A number that grows each time the item changes. Use it in memo dependencies of an observer render, because the
|
|
9048
|
-
* item object itself stays the same after an update. A computed that returns the item object must also return this
|
|
9049
|
-
* value, or MobX sees the same object and passes no change on.
|
|
9050
|
-
*/
|
|
9051
|
-
DataStoreWithSignals.prototype.getVersion = function (id) {
|
|
9052
|
-
return this.signals.version(id);
|
|
9053
|
-
};
|
|
9054
9036
|
DataStoreWithSignals.prototype.getAll = function () {
|
|
9055
9037
|
this.signals.observeAll();
|
|
9056
9038
|
return this.store.getAll();
|
|
@@ -9129,13 +9111,33 @@ var ItemChangeSignals = /** @class */ (function () {
|
|
|
9129
9111
|
function ItemChangeSignals(storeId) {
|
|
9130
9112
|
this.storeId = storeId;
|
|
9131
9113
|
// Keyed by Number(id): stores accept number-like string ids too.
|
|
9132
|
-
this.
|
|
9133
|
-
// Store-wide clock: a re-created entry starts here, so an equal version always means no change since.
|
|
9134
|
-
this.seq = 0;
|
|
9114
|
+
this.atoms = new Map();
|
|
9135
9115
|
}
|
|
9136
9116
|
/** Reports a read of `id`. Subscribes the current reaction to changes of that id. */
|
|
9137
9117
|
ItemChangeSignals.prototype.observe = function (id) {
|
|
9138
|
-
|
|
9118
|
+
if (id === undefined || id === null || !getMobx()) {
|
|
9119
|
+
return;
|
|
9120
|
+
}
|
|
9121
|
+
id = Number(id);
|
|
9122
|
+
// Cheap filter, the probe never fires: false for a read outside any derivation, so no per-id atom is created on the
|
|
9123
|
+
// hot path. Such a read reports only the shared `anyChange` atom.
|
|
9124
|
+
if (!this.getProbe().reportObserved()) {
|
|
9125
|
+
this.getAnyChange().reportObserved();
|
|
9126
|
+
return;
|
|
9127
|
+
}
|
|
9128
|
+
var atom = this.atoms.get(id);
|
|
9129
|
+
var isNew = !atom;
|
|
9130
|
+
if (isNew) {
|
|
9131
|
+
atom = this.createAtom(id);
|
|
9132
|
+
}
|
|
9133
|
+
// Exact check: false for a new atom read by a computed evaluated inside an action (no reaction behind it).
|
|
9134
|
+
// MobX never calls the unobserve callback of such an atom, so it would leak; watch `anyChange` instead.
|
|
9135
|
+
if (!atom.reportObserved()) {
|
|
9136
|
+
if (isNew) {
|
|
9137
|
+
this.atoms.delete(id);
|
|
9138
|
+
}
|
|
9139
|
+
this.getAnyChange().reportObserved();
|
|
9140
|
+
}
|
|
9139
9141
|
};
|
|
9140
9142
|
/** Reports a read of the whole store (list readers). Subscribes the current reaction to every change. */
|
|
9141
9143
|
ItemChangeSignals.prototype.observeAll = function () {
|
|
@@ -9143,36 +9145,19 @@ var ItemChangeSignals = /** @class */ (function () {
|
|
|
9143
9145
|
this.getAnyChange().reportObserved();
|
|
9144
9146
|
}
|
|
9145
9147
|
};
|
|
9146
|
-
/**
|
|
9147
|
-
* Version of `id`: grows on every signal of that id. Meaningful only inside a reaction (it subscribes it);
|
|
9148
|
-
* outside a reaction it returns the store-wide counter, so a memo keyed by it is never stale.
|
|
9149
|
-
*/
|
|
9150
|
-
ItemChangeSignals.prototype.version = function (id) {
|
|
9151
|
-
var _a, _b;
|
|
9152
|
-
this.track(id);
|
|
9153
|
-
return (_b = (_a = this.entries.get(Number(id))) === null || _a === void 0 ? void 0 : _a.version) !== null && _b !== void 0 ? _b : this.seq;
|
|
9154
|
-
};
|
|
9155
9148
|
/** Reports a change of each id, in one MobX action, then fires `anyChange` once. */
|
|
9156
9149
|
ItemChangeSignals.prototype.notify = function (ids) {
|
|
9157
9150
|
var _this = this;
|
|
9158
|
-
if (!ids.length) {
|
|
9159
|
-
return;
|
|
9160
|
-
}
|
|
9161
|
-
this.seq++;
|
|
9162
|
-
if (!this.anyChange && !this.entries.size) {
|
|
9163
|
-
// Nothing was ever observed: no reaction to tell.
|
|
9151
|
+
if (!ids.length || !this.hasBeenRead()) {
|
|
9164
9152
|
return;
|
|
9165
9153
|
}
|
|
9166
9154
|
getMobx().runInAction(function () {
|
|
9167
9155
|
var e_1, _a;
|
|
9156
|
+
var _b;
|
|
9168
9157
|
try {
|
|
9169
9158
|
for (var ids_1 = __values(ids), ids_1_1 = ids_1.next(); !ids_1_1.done; ids_1_1 = ids_1.next()) {
|
|
9170
9159
|
var id = ids_1_1.value;
|
|
9171
|
-
|
|
9172
|
-
if (entry) {
|
|
9173
|
-
entry.version = _this.seq;
|
|
9174
|
-
entry.atom.reportChanged();
|
|
9175
|
-
}
|
|
9160
|
+
(_b = _this.atoms.get(Number(id))) === null || _b === void 0 ? void 0 : _b.reportChanged();
|
|
9176
9161
|
}
|
|
9177
9162
|
}
|
|
9178
9163
|
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
@@ -9188,17 +9173,15 @@ var ItemChangeSignals = /** @class */ (function () {
|
|
|
9188
9173
|
/** Reports a change of every observed id (a store reload or a bulk remove). */
|
|
9189
9174
|
ItemChangeSignals.prototype.notifyAllObserved = function () {
|
|
9190
9175
|
var _this = this;
|
|
9191
|
-
this.
|
|
9192
|
-
if (!this.anyChange && !this.entries.size) {
|
|
9176
|
+
if (!this.hasBeenRead()) {
|
|
9193
9177
|
return;
|
|
9194
9178
|
}
|
|
9195
9179
|
getMobx().runInAction(function () {
|
|
9196
9180
|
var e_2, _a;
|
|
9197
9181
|
try {
|
|
9198
|
-
for (var _b = __values(_this.
|
|
9199
|
-
var
|
|
9200
|
-
|
|
9201
|
-
entry.atom.reportChanged();
|
|
9182
|
+
for (var _b = __values(_this.atoms.values()), _c = _b.next(); !_c.done; _c = _b.next()) {
|
|
9183
|
+
var atom = _c.value;
|
|
9184
|
+
atom.reportChanged();
|
|
9202
9185
|
}
|
|
9203
9186
|
}
|
|
9204
9187
|
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
@@ -9212,51 +9195,28 @@ var ItemChangeSignals = /** @class */ (function () {
|
|
|
9212
9195
|
});
|
|
9213
9196
|
};
|
|
9214
9197
|
Object.defineProperty(ItemChangeSignals.prototype, "observedCount", {
|
|
9215
|
-
/** Number of live id
|
|
9198
|
+
/** Number of live id atoms. For tests only. */
|
|
9216
9199
|
get: function () {
|
|
9217
|
-
return this.
|
|
9200
|
+
return this.atoms.size;
|
|
9218
9201
|
},
|
|
9219
9202
|
enumerable: false,
|
|
9220
9203
|
configurable: true
|
|
9221
9204
|
});
|
|
9222
|
-
|
|
9223
|
-
|
|
9224
|
-
|
|
9225
|
-
}
|
|
9226
|
-
id = Number(id);
|
|
9227
|
-
// Cheap filter, the probe never fires: false for a read outside any derivation, so no atom is created on the hot path.
|
|
9228
|
-
if (!this.getProbe().reportObserved()) {
|
|
9229
|
-
this.getAnyChange().reportObserved();
|
|
9230
|
-
return;
|
|
9231
|
-
}
|
|
9232
|
-
var entry = this.entries.get(id);
|
|
9233
|
-
var isNew = !entry;
|
|
9234
|
-
if (isNew) {
|
|
9235
|
-
entry = this.createEntry(id);
|
|
9236
|
-
}
|
|
9237
|
-
// Exact check: false for a new atom read by a computed evaluated inside an action (no reaction behind it).
|
|
9238
|
-
// MobX never calls the unobserve callback of such an atom, so the entry would leak; watch `anyChange` instead.
|
|
9239
|
-
if (!entry.atom.reportObserved()) {
|
|
9240
|
-
if (isNew) {
|
|
9241
|
-
this.entries.delete(id);
|
|
9242
|
-
}
|
|
9243
|
-
this.getAnyChange().reportObserved();
|
|
9244
|
-
}
|
|
9205
|
+
// False until the first read: before it, no reaction can be watching.
|
|
9206
|
+
ItemChangeSignals.prototype.hasBeenRead = function () {
|
|
9207
|
+
return Boolean(this.anyChange) || this.atoms.size > 0;
|
|
9245
9208
|
};
|
|
9246
|
-
ItemChangeSignals.prototype.
|
|
9209
|
+
ItemChangeSignals.prototype.createAtom = function (id) {
|
|
9247
9210
|
var _this = this;
|
|
9248
|
-
// The callback reads `
|
|
9211
|
+
// The callback reads `atom` only when MobX calls it, at the end of a batch after the last observer left,
|
|
9249
9212
|
// never during `createAtom`.
|
|
9250
|
-
var
|
|
9251
|
-
|
|
9252
|
-
|
|
9253
|
-
|
|
9254
|
-
|
|
9255
|
-
|
|
9256
|
-
|
|
9257
|
-
};
|
|
9258
|
-
this.entries.set(id, entry);
|
|
9259
|
-
return entry;
|
|
9213
|
+
var atom = getMobx().createAtom("".concat(this.storeId, ".item.").concat(id), undefined, function () {
|
|
9214
|
+
if (_this.atoms.get(id) === atom) {
|
|
9215
|
+
_this.atoms.delete(id);
|
|
9216
|
+
}
|
|
9217
|
+
});
|
|
9218
|
+
this.atoms.set(id, atom);
|
|
9219
|
+
return atom;
|
|
9260
9220
|
};
|
|
9261
9221
|
ItemChangeSignals.prototype.getProbe = function () {
|
|
9262
9222
|
if (!this.probe) {
|
|
@@ -25534,7 +25494,7 @@ var BringgException_1 = __webpack_require__(43605);
|
|
|
25534
25494
|
var client_page_1 = __webpack_require__(16573);
|
|
25535
25495
|
var Logger_1 = __importDefault(__webpack_require__(55860));
|
|
25536
25496
|
var abort_1 = __webpack_require__(34179);
|
|
25537
|
-
var version = '10.2.3-pre.
|
|
25497
|
+
var version = '10.2.3-pre.2';
|
|
25538
25498
|
function logErrorResponse(response) {
|
|
25539
25499
|
var data = response.data, status = response.status;
|
|
25540
25500
|
try {
|