api-core-lib 12.0.16 → 12.0.18
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/client.cjs +2 -3
- package/dist/client.js +2 -3
- package/dist/index.cjs +2 -3
- package/dist/index.js +2 -3
- package/dist/server.cjs +2 -3
- package/dist/server.js +2 -3
- package/package.json +1 -1
package/dist/client.cjs
CHANGED
|
@@ -590,7 +590,6 @@ var GlobalStateManager = class {
|
|
|
590
590
|
if (!this.store.has(key)) {
|
|
591
591
|
const initialState = createInitialState();
|
|
592
592
|
this.store.set(key, { state: initialState, listeners: /* @__PURE__ */ new Set() });
|
|
593
|
-
return initialState;
|
|
594
593
|
}
|
|
595
594
|
return this.store.get(key).state;
|
|
596
595
|
}
|
|
@@ -612,12 +611,12 @@ var GlobalStateManager = class {
|
|
|
612
611
|
* يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
|
|
613
612
|
*/
|
|
614
613
|
setState(key, updater) {
|
|
615
|
-
const
|
|
616
|
-
const currentState = item.state;
|
|
614
|
+
const currentState = this.getSnapshot(key);
|
|
617
615
|
const newState = updater(currentState);
|
|
618
616
|
if (Object.is(currentState, newState)) {
|
|
619
617
|
return;
|
|
620
618
|
}
|
|
619
|
+
const item = this.store.get(key);
|
|
621
620
|
item.state = newState;
|
|
622
621
|
item.listeners.forEach((listener) => listener());
|
|
623
622
|
}
|
package/dist/client.js
CHANGED
|
@@ -551,7 +551,6 @@ var GlobalStateManager = class {
|
|
|
551
551
|
if (!this.store.has(key)) {
|
|
552
552
|
const initialState = createInitialState();
|
|
553
553
|
this.store.set(key, { state: initialState, listeners: /* @__PURE__ */ new Set() });
|
|
554
|
-
return initialState;
|
|
555
554
|
}
|
|
556
555
|
return this.store.get(key).state;
|
|
557
556
|
}
|
|
@@ -573,12 +572,12 @@ var GlobalStateManager = class {
|
|
|
573
572
|
* يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
|
|
574
573
|
*/
|
|
575
574
|
setState(key, updater) {
|
|
576
|
-
const
|
|
577
|
-
const currentState = item.state;
|
|
575
|
+
const currentState = this.getSnapshot(key);
|
|
578
576
|
const newState = updater(currentState);
|
|
579
577
|
if (Object.is(currentState, newState)) {
|
|
580
578
|
return;
|
|
581
579
|
}
|
|
580
|
+
const item = this.store.get(key);
|
|
582
581
|
item.state = newState;
|
|
583
582
|
item.listeners.forEach((listener) => listener());
|
|
584
583
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -548,7 +548,6 @@ var GlobalStateManager = class {
|
|
|
548
548
|
if (!this.store.has(key)) {
|
|
549
549
|
const initialState = createInitialState();
|
|
550
550
|
this.store.set(key, { state: initialState, listeners: /* @__PURE__ */ new Set() });
|
|
551
|
-
return initialState;
|
|
552
551
|
}
|
|
553
552
|
return this.store.get(key).state;
|
|
554
553
|
}
|
|
@@ -570,12 +569,12 @@ var GlobalStateManager = class {
|
|
|
570
569
|
* يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
|
|
571
570
|
*/
|
|
572
571
|
setState(key, updater) {
|
|
573
|
-
const
|
|
574
|
-
const currentState = item.state;
|
|
572
|
+
const currentState = this.getSnapshot(key);
|
|
575
573
|
const newState = updater(currentState);
|
|
576
574
|
if (Object.is(currentState, newState)) {
|
|
577
575
|
return;
|
|
578
576
|
}
|
|
577
|
+
const item = this.store.get(key);
|
|
579
578
|
item.state = newState;
|
|
580
579
|
item.listeners.forEach((listener) => listener());
|
|
581
580
|
}
|
package/dist/index.js
CHANGED
|
@@ -506,7 +506,6 @@ var GlobalStateManager = class {
|
|
|
506
506
|
if (!this.store.has(key)) {
|
|
507
507
|
const initialState = createInitialState();
|
|
508
508
|
this.store.set(key, { state: initialState, listeners: /* @__PURE__ */ new Set() });
|
|
509
|
-
return initialState;
|
|
510
509
|
}
|
|
511
510
|
return this.store.get(key).state;
|
|
512
511
|
}
|
|
@@ -528,12 +527,12 @@ var GlobalStateManager = class {
|
|
|
528
527
|
* يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
|
|
529
528
|
*/
|
|
530
529
|
setState(key, updater) {
|
|
531
|
-
const
|
|
532
|
-
const currentState = item.state;
|
|
530
|
+
const currentState = this.getSnapshot(key);
|
|
533
531
|
const newState = updater(currentState);
|
|
534
532
|
if (Object.is(currentState, newState)) {
|
|
535
533
|
return;
|
|
536
534
|
}
|
|
535
|
+
const item = this.store.get(key);
|
|
537
536
|
item.state = newState;
|
|
538
537
|
item.listeners.forEach((listener) => listener());
|
|
539
538
|
}
|
package/dist/server.cjs
CHANGED
|
@@ -199,7 +199,6 @@ var GlobalStateManager = class {
|
|
|
199
199
|
if (!this.store.has(key)) {
|
|
200
200
|
const initialState = createInitialState();
|
|
201
201
|
this.store.set(key, { state: initialState, listeners: /* @__PURE__ */ new Set() });
|
|
202
|
-
return initialState;
|
|
203
202
|
}
|
|
204
203
|
return this.store.get(key).state;
|
|
205
204
|
}
|
|
@@ -221,12 +220,12 @@ var GlobalStateManager = class {
|
|
|
221
220
|
* يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
|
|
222
221
|
*/
|
|
223
222
|
setState(key, updater) {
|
|
224
|
-
const
|
|
225
|
-
const currentState = item.state;
|
|
223
|
+
const currentState = this.getSnapshot(key);
|
|
226
224
|
const newState = updater(currentState);
|
|
227
225
|
if (Object.is(currentState, newState)) {
|
|
228
226
|
return;
|
|
229
227
|
}
|
|
228
|
+
const item = this.store.get(key);
|
|
230
229
|
item.state = newState;
|
|
231
230
|
item.listeners.forEach((listener) => listener());
|
|
232
231
|
}
|
package/dist/server.js
CHANGED
|
@@ -165,7 +165,6 @@ var GlobalStateManager = class {
|
|
|
165
165
|
if (!this.store.has(key)) {
|
|
166
166
|
const initialState = createInitialState();
|
|
167
167
|
this.store.set(key, { state: initialState, listeners: /* @__PURE__ */ new Set() });
|
|
168
|
-
return initialState;
|
|
169
168
|
}
|
|
170
169
|
return this.store.get(key).state;
|
|
171
170
|
}
|
|
@@ -187,12 +186,12 @@ var GlobalStateManager = class {
|
|
|
187
186
|
* يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
|
|
188
187
|
*/
|
|
189
188
|
setState(key, updater) {
|
|
190
|
-
const
|
|
191
|
-
const currentState = item.state;
|
|
189
|
+
const currentState = this.getSnapshot(key);
|
|
192
190
|
const newState = updater(currentState);
|
|
193
191
|
if (Object.is(currentState, newState)) {
|
|
194
192
|
return;
|
|
195
193
|
}
|
|
194
|
+
const item = this.store.get(key);
|
|
196
195
|
item.state = newState;
|
|
197
196
|
item.listeners.forEach((listener) => listener());
|
|
198
197
|
}
|