api-core-lib 12.0.17 → 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 CHANGED
@@ -611,12 +611,12 @@ var GlobalStateManager = class {
611
611
  * يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
612
612
  */
613
613
  setState(key, updater) {
614
- const item = this.store.get(key);
615
- const currentState = item.state;
614
+ const currentState = this.getSnapshot(key);
616
615
  const newState = updater(currentState);
617
616
  if (Object.is(currentState, newState)) {
618
617
  return;
619
618
  }
619
+ const item = this.store.get(key);
620
620
  item.state = newState;
621
621
  item.listeners.forEach((listener) => listener());
622
622
  }
package/dist/client.js CHANGED
@@ -572,12 +572,12 @@ var GlobalStateManager = class {
572
572
  * يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
573
573
  */
574
574
  setState(key, updater) {
575
- const item = this.store.get(key);
576
- const currentState = item.state;
575
+ const currentState = this.getSnapshot(key);
577
576
  const newState = updater(currentState);
578
577
  if (Object.is(currentState, newState)) {
579
578
  return;
580
579
  }
580
+ const item = this.store.get(key);
581
581
  item.state = newState;
582
582
  item.listeners.forEach((listener) => listener());
583
583
  }
package/dist/index.cjs CHANGED
@@ -569,12 +569,12 @@ var GlobalStateManager = class {
569
569
  * يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
570
570
  */
571
571
  setState(key, updater) {
572
- const item = this.store.get(key);
573
- const currentState = item.state;
572
+ const currentState = this.getSnapshot(key);
574
573
  const newState = updater(currentState);
575
574
  if (Object.is(currentState, newState)) {
576
575
  return;
577
576
  }
577
+ const item = this.store.get(key);
578
578
  item.state = newState;
579
579
  item.listeners.forEach((listener) => listener());
580
580
  }
package/dist/index.js CHANGED
@@ -527,12 +527,12 @@ var GlobalStateManager = class {
527
527
  * يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
528
528
  */
529
529
  setState(key, updater) {
530
- const item = this.store.get(key);
531
- const currentState = item.state;
530
+ const currentState = this.getSnapshot(key);
532
531
  const newState = updater(currentState);
533
532
  if (Object.is(currentState, newState)) {
534
533
  return;
535
534
  }
535
+ const item = this.store.get(key);
536
536
  item.state = newState;
537
537
  item.listeners.forEach((listener) => listener());
538
538
  }
package/dist/server.cjs CHANGED
@@ -220,12 +220,12 @@ var GlobalStateManager = class {
220
220
  * يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
221
221
  */
222
222
  setState(key, updater) {
223
- const item = this.store.get(key);
224
- const currentState = item.state;
223
+ const currentState = this.getSnapshot(key);
225
224
  const newState = updater(currentState);
226
225
  if (Object.is(currentState, newState)) {
227
226
  return;
228
227
  }
228
+ const item = this.store.get(key);
229
229
  item.state = newState;
230
230
  item.listeners.forEach((listener) => listener());
231
231
  }
package/dist/server.js CHANGED
@@ -186,12 +186,12 @@ var GlobalStateManager = class {
186
186
  * يحدّث الحالة لمفتاح معين ويقوم بإعلام جميع المشتركين.
187
187
  */
188
188
  setState(key, updater) {
189
- const item = this.store.get(key);
190
- const currentState = item.state;
189
+ const currentState = this.getSnapshot(key);
191
190
  const newState = updater(currentState);
192
191
  if (Object.is(currentState, newState)) {
193
192
  return;
194
193
  }
194
+ const item = this.store.get(key);
195
195
  item.state = newState;
196
196
  item.listeners.forEach((listener) => listener());
197
197
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api-core-lib",
3
- "version": "12.0.17",
3
+ "version": "12.0.18",
4
4
  "description": "A flexible and powerful API client library for modern web applications.",
5
5
  "type": "module",
6
6