@wirestate/core 0.7.0-experimental.2 → 0.7.0-experimental.3

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.
Files changed (136) hide show
  1. package/cjs/development/index.js +28 -26
  2. package/cjs/development/index.js.map +1 -1
  3. package/cjs/development/lib.js +233 -287
  4. package/cjs/development/lib.js.map +1 -1
  5. package/cjs/development/test-utils.js +22 -38
  6. package/cjs/development/test-utils.js.map +1 -1
  7. package/cjs/production/index.js +1 -1
  8. package/cjs/production/index.js.map +1 -1
  9. package/cjs/production/lib.js +1 -1
  10. package/cjs/production/lib.js.map +1 -1
  11. package/cjs/production/test-utils.js +1 -1
  12. package/cjs/production/test-utils.js.map +1 -1
  13. package/esm/development/bind/bind-dynamic-value.js +1 -1
  14. package/esm/development/bind/bind-dynamic-value.js.map +1 -1
  15. package/esm/development/bind/bind-entry.js +1 -4
  16. package/esm/development/bind/bind-entry.js.map +1 -1
  17. package/esm/development/bind/bind-service.js +40 -54
  18. package/esm/development/bind/bind-service.js.map +1 -1
  19. package/esm/development/commands/command-bus.js +33 -42
  20. package/esm/development/commands/command-bus.js.map +1 -1
  21. package/esm/development/commands/get-command-handler-metadata.js +3 -3
  22. package/esm/development/commands/get-command-handler-metadata.js.map +1 -1
  23. package/esm/development/commands/on-command.js +4 -4
  24. package/esm/development/commands/on-command.js.map +1 -1
  25. package/esm/development/container/create-base-container.js +2 -3
  26. package/esm/development/container/create-base-container.js.map +1 -1
  27. package/esm/development/container/create-container.js +9 -18
  28. package/esm/development/container/create-container.js.map +1 -1
  29. package/esm/development/container/wire-scope.js +41 -42
  30. package/esm/development/container/wire-scope.js.map +1 -1
  31. package/esm/development/error/error-code.js +8 -8
  32. package/esm/development/error/error-code.js.map +1 -1
  33. package/esm/development/error/wirestate-error.js +18 -17
  34. package/esm/development/error/wirestate-error.js.map +1 -1
  35. package/esm/development/events/build-event-dispatcher.js +5 -7
  36. package/esm/development/events/build-event-dispatcher.js.map +1 -1
  37. package/esm/development/events/emit-event.js +3 -3
  38. package/esm/development/events/emit-event.js.map +1 -1
  39. package/esm/development/events/event-bus.js +16 -23
  40. package/esm/development/events/event-bus.js.map +1 -1
  41. package/esm/development/events/get-event-handler-metadata.js +3 -3
  42. package/esm/development/events/get-event-handler-metadata.js.map +1 -1
  43. package/esm/development/events/on-event.js +4 -5
  44. package/esm/development/events/on-event.js.map +1 -1
  45. package/esm/development/queries/get-query-handler-metadata.js +3 -3
  46. package/esm/development/queries/get-query-handler-metadata.js.map +1 -1
  47. package/esm/development/queries/on-query.js +4 -4
  48. package/esm/development/queries/on-query.js.map +1 -1
  49. package/esm/development/queries/query-bus.js +29 -35
  50. package/esm/development/queries/query-bus.js.map +1 -1
  51. package/esm/development/registry.js +10 -10
  52. package/esm/development/registry.js.map +1 -1
  53. package/esm/development/seeds/apply-seeds.js +2 -5
  54. package/esm/development/seeds/apply-seeds.js.map +1 -1
  55. package/esm/development/seeds/tokens.js +2 -2
  56. package/esm/development/seeds/tokens.js.map +1 -1
  57. package/esm/development/seeds/unapply-seeds.js +2 -3
  58. package/esm/development/seeds/unapply-seeds.js.map +1 -1
  59. package/esm/development/service/get-activated-handler-metadata.js +3 -3
  60. package/esm/development/service/get-activated-handler-metadata.js.map +1 -1
  61. package/esm/development/service/get-deactivation-handler-metadata.js +3 -3
  62. package/esm/development/service/get-deactivation-handler-metadata.js.map +1 -1
  63. package/esm/development/service/on-activated.js +3 -3
  64. package/esm/development/service/on-activated.js.map +1 -1
  65. package/esm/development/service/on-deactivation.js +3 -3
  66. package/esm/development/service/on-deactivation.js.map +1 -1
  67. package/esm/development/test-utils/mock-bind-entry.js +4 -5
  68. package/esm/development/test-utils/mock-bind-entry.js.map +1 -1
  69. package/esm/development/test-utils/mock-bind-service.js +4 -5
  70. package/esm/development/test-utils/mock-bind-service.js.map +1 -1
  71. package/esm/development/test-utils/mock-container.js +13 -21
  72. package/esm/development/test-utils/mock-container.js.map +1 -1
  73. package/esm/development/test-utils/mock-service.js +1 -7
  74. package/esm/development/test-utils/mock-service.js.map +1 -1
  75. package/esm/production/bind/bind-dynamic-value.js +1 -1
  76. package/esm/production/bind/bind-dynamic-value.js.map +1 -1
  77. package/esm/production/bind/bind-entry.js +1 -1
  78. package/esm/production/bind/bind-entry.js.map +1 -1
  79. package/esm/production/bind/bind-service.js +1 -1
  80. package/esm/production/bind/bind-service.js.map +1 -1
  81. package/esm/production/commands/command-bus.js +1 -1
  82. package/esm/production/commands/command-bus.js.map +1 -1
  83. package/esm/production/commands/get-command-handler-metadata.js +1 -1
  84. package/esm/production/commands/get-command-handler-metadata.js.map +1 -1
  85. package/esm/production/commands/on-command.js +1 -1
  86. package/esm/production/commands/on-command.js.map +1 -1
  87. package/esm/production/container/create-base-container.js +1 -1
  88. package/esm/production/container/create-base-container.js.map +1 -1
  89. package/esm/production/container/create-container.js +1 -1
  90. package/esm/production/container/create-container.js.map +1 -1
  91. package/esm/production/container/wire-scope.js +1 -1
  92. package/esm/production/container/wire-scope.js.map +1 -1
  93. package/esm/production/error/error-code.js +1 -1
  94. package/esm/production/error/error-code.js.map +1 -1
  95. package/esm/production/error/wirestate-error.js +1 -1
  96. package/esm/production/error/wirestate-error.js.map +1 -1
  97. package/esm/production/events/build-event-dispatcher.js +1 -1
  98. package/esm/production/events/build-event-dispatcher.js.map +1 -1
  99. package/esm/production/events/emit-event.js.map +1 -1
  100. package/esm/production/events/event-bus.js +1 -1
  101. package/esm/production/events/event-bus.js.map +1 -1
  102. package/esm/production/events/get-event-handler-metadata.js +1 -1
  103. package/esm/production/events/get-event-handler-metadata.js.map +1 -1
  104. package/esm/production/events/on-event.js +1 -1
  105. package/esm/production/events/on-event.js.map +1 -1
  106. package/esm/production/queries/get-query-handler-metadata.js +1 -1
  107. package/esm/production/queries/get-query-handler-metadata.js.map +1 -1
  108. package/esm/production/queries/on-query.js +1 -1
  109. package/esm/production/queries/on-query.js.map +1 -1
  110. package/esm/production/queries/query-bus.js +1 -1
  111. package/esm/production/queries/query-bus.js.map +1 -1
  112. package/esm/production/registry.js +1 -1
  113. package/esm/production/registry.js.map +1 -1
  114. package/esm/production/seeds/apply-seeds.js +1 -1
  115. package/esm/production/seeds/apply-seeds.js.map +1 -1
  116. package/esm/production/seeds/tokens.js +1 -1
  117. package/esm/production/seeds/tokens.js.map +1 -1
  118. package/esm/production/seeds/unapply-seeds.js +1 -1
  119. package/esm/production/seeds/unapply-seeds.js.map +1 -1
  120. package/esm/production/service/get-activated-handler-metadata.js +1 -1
  121. package/esm/production/service/get-activated-handler-metadata.js.map +1 -1
  122. package/esm/production/service/get-deactivation-handler-metadata.js +1 -1
  123. package/esm/production/service/get-deactivation-handler-metadata.js.map +1 -1
  124. package/esm/production/service/on-activated.js +1 -1
  125. package/esm/production/service/on-activated.js.map +1 -1
  126. package/esm/production/service/on-deactivation.js +1 -1
  127. package/esm/production/service/on-deactivation.js.map +1 -1
  128. package/esm/production/test-utils/mock-bind-entry.js +1 -1
  129. package/esm/production/test-utils/mock-bind-entry.js.map +1 -1
  130. package/esm/production/test-utils/mock-bind-service.js +1 -1
  131. package/esm/production/test-utils/mock-bind-service.js.map +1 -1
  132. package/esm/production/test-utils/mock-container.js +1 -1
  133. package/esm/production/test-utils/mock-container.js.map +1 -1
  134. package/esm/production/test-utils/mock-service.js +1 -1
  135. package/esm/production/test-utils/mock-service.js.map +1 -1
  136. package/package.json +1 -1
@@ -18,13 +18,13 @@ import { SEEDS_TOKEN, SEED_TOKEN } from '../seeds/tokens.js';
18
18
  *
19
19
  * @group Container
20
20
  */
21
- var WireScope = /** @class */function () {
22
- function WireScope(container) {
21
+ let WireScope = class WireScope {
22
+ /**
23
+ * Whether the scope was deactivated and disposed from the container.
24
+ */
25
+ isDisposed = false;
26
+ constructor(container) {
23
27
  this.container = container;
24
- /**
25
- * Whether the scope was deactivated and disposed from the container.
26
- */
27
- this.isDisposed = false;
28
28
  }
29
29
  /**
30
30
  * Provides direct access to the underlying Inversify {@link Container}.
@@ -40,7 +40,7 @@ var WireScope = /** @class */function () {
40
40
  * container.bind("TOKEN").toConstantValue(42);
41
41
  * ```
42
42
  */
43
- WireScope.prototype.getContainer = function () {
43
+ getContainer() {
44
44
  if (this.container) {
45
45
  return this.container;
46
46
  }
@@ -49,7 +49,7 @@ var WireScope = /** @class */function () {
49
49
  } else {
50
50
  throw new WirestateError(ERROR_CODE_ACCESS_BEFORE_ACTIVATION, "WireScope::container accessed before activation. " + "Ensure service is bound to container and is properly resolved.");
51
51
  }
52
- };
52
+ }
53
53
  /**
54
54
  * Lazily resolves a service or value from the container.
55
55
  *
@@ -69,9 +69,9 @@ var WireScope = /** @class */function () {
69
69
  * const service: MyService = scope.resolve(MyService);
70
70
  * ```
71
71
  */
72
- WireScope.prototype.resolve = function (injectionId) {
72
+ resolve(injectionId) {
73
73
  return this.getContainer().get(injectionId);
74
- };
74
+ }
75
75
  /**
76
76
  * Lazily resolves a service if it is bound, otherwise returns null.
77
77
  *
@@ -89,10 +89,10 @@ var WireScope = /** @class */function () {
89
89
  * logger?.info("Resolved optionally");
90
90
  * ```
91
91
  */
92
- WireScope.prototype.resolveOptional = function (injectionId) {
93
- var container = this.getContainer();
92
+ resolveOptional(injectionId) {
93
+ const container = this.getContainer();
94
94
  return container.isBound(injectionId) ? container.get(injectionId) : null;
95
- };
95
+ }
96
96
  /**
97
97
  * Dispatches an event to the {@link EventBus}.
98
98
  *
@@ -110,13 +110,13 @@ var WireScope = /** @class */function () {
110
110
  * scope.emitEvent("VALUE_CHANGED", { value: "abcd" });
111
111
  * ```
112
112
  */
113
- WireScope.prototype.emitEvent = function (type, payload, from) {
113
+ emitEvent(type, payload, from) {
114
114
  this.getContainer().get(EventBus).emit({
115
- type: type,
116
- payload: payload,
115
+ type,
116
+ payload,
117
117
  from: from === undefined ? this : from
118
118
  });
119
- };
119
+ }
120
120
  /**
121
121
  * Subscribes to all events on the {@link EventBus}.
122
122
  *
@@ -132,9 +132,9 @@ var WireScope = /** @class */function () {
132
132
  * });
133
133
  * ```
134
134
  */
135
- WireScope.prototype.subscribeToEvent = function (handler) {
135
+ subscribeToEvent(handler) {
136
136
  return this.getContainer().get(EventBus).subscribe(handler);
137
- };
137
+ }
138
138
  /**
139
139
  * Unsubscribes a specific handler from the {@link EventBus}.
140
140
  *
@@ -147,9 +147,9 @@ var WireScope = /** @class */function () {
147
147
  * scope.unsubscribeFromEvent(this.onEvent);
148
148
  * ```
149
149
  */
150
- WireScope.prototype.unsubscribeFromEvent = function (handler) {
150
+ unsubscribeFromEvent(handler) {
151
151
  this.getContainer().get(EventBus).unsubscribe(handler);
152
- };
152
+ }
153
153
  /**
154
154
  * Dispatches a query and waits for the result.
155
155
  *
@@ -169,9 +169,9 @@ var WireScope = /** @class */function () {
169
169
  * const user: User = await scope.queryData("GET_USER", { id: 1 });
170
170
  * ```
171
171
  */
172
- WireScope.prototype.queryData = function (type, data) {
172
+ queryData(type, data) {
173
173
  return this.getContainer().get(QueryBus).query(type, data);
174
- };
174
+ }
175
175
  /**
176
176
  * Dispatches a query and returns the result, or null if no handler is registered.
177
177
  *
@@ -190,9 +190,9 @@ var WireScope = /** @class */function () {
190
190
  * const config: Config | null = await scope.queryOptionalData("GET_CONFIG");
191
191
  * ```
192
192
  */
193
- WireScope.prototype.queryOptionalData = function (type, data) {
193
+ queryOptionalData(type, data) {
194
194
  return this.getContainer().get(QueryBus).queryOptional(type, data);
195
- };
195
+ }
196
196
  /**
197
197
  * Registers a handler for a specific query type.
198
198
  *
@@ -210,9 +210,9 @@ var WireScope = /** @class */function () {
210
210
  * scope.registerQueryHandler("GET_DATE_NOW", () => new Date());
211
211
  * ```
212
212
  */
213
- WireScope.prototype.registerQueryHandler = function (type, handler) {
213
+ registerQueryHandler(type, handler) {
214
214
  return this.getContainer().get(QueryBus).register(type, handler);
215
- };
215
+ }
216
216
  /**
217
217
  * Removes a specific query handler registration.
218
218
  *
@@ -229,9 +229,9 @@ var WireScope = /** @class */function () {
229
229
  * scope.unregisterQueryHandler("GET_DATE_NOW", this.onGetDateNow);
230
230
  * ```
231
231
  */
232
- WireScope.prototype.unregisterQueryHandler = function (type, handler) {
232
+ unregisterQueryHandler(type, handler) {
233
233
  this.getContainer().get(QueryBus).unregister(type, handler);
234
- };
234
+ }
235
235
  /**
236
236
  * Dispatches a command and returns a descriptor to track its progress.
237
237
  *
@@ -253,9 +253,9 @@ var WireScope = /** @class */function () {
253
253
  * await descriptor.task;
254
254
  * ```
255
255
  */
256
- WireScope.prototype.executeCommand = function (type, data) {
256
+ executeCommand(type, data) {
257
257
  return this.getContainer().get(CommandBus).command(type, data);
258
- };
258
+ }
259
259
  /**
260
260
  * Dispatches a command if a handler is registered, otherwise returns null.
261
261
  *
@@ -278,9 +278,9 @@ var WireScope = /** @class */function () {
278
278
  * }
279
279
  * ```
280
280
  */
281
- WireScope.prototype.executeOptionalCommand = function (type, data) {
281
+ executeOptionalCommand(type, data) {
282
282
  return this.getContainer().get(CommandBus).commandOptional(type, data);
283
- };
283
+ }
284
284
  /**
285
285
  * Registers a handler for a specific command type.
286
286
  *
@@ -300,9 +300,9 @@ var WireScope = /** @class */function () {
300
300
  * });
301
301
  * ```
302
302
  */
303
- WireScope.prototype.registerCommandHandler = function (type, handler) {
303
+ registerCommandHandler(type, handler) {
304
304
  return this.getContainer().get(CommandBus).register(type, handler);
305
- };
305
+ }
306
306
  /**
307
307
  * Removes a specific command handler registration.
308
308
  *
@@ -319,15 +319,14 @@ var WireScope = /** @class */function () {
319
319
  * scope.unregisterCommandHandler("LOG_ERROR", this.handleLogError);
320
320
  * ```
321
321
  */
322
- WireScope.prototype.unregisterCommandHandler = function (type, handler) {
322
+ unregisterCommandHandler(type, handler) {
323
323
  this.getContainer().get(CommandBus).unregister(type, handler);
324
- };
325
- WireScope.prototype.getSeed = function (seed) {
324
+ }
325
+ getSeed(seed) {
326
326
  return seed ? this.getContainer().get(SEEDS_TOKEN).get(seed) || null : this.getContainer().get(SEED_TOKEN);
327
- };
328
- WireScope = __decorate([injectable(), __metadata("design:paramtypes", [Object])], WireScope);
329
- return WireScope;
330
- }();
327
+ }
328
+ };
329
+ WireScope = __decorate([injectable(), __metadata("design:paramtypes", [Object])], WireScope);
331
330
 
332
331
  export { WireScope };
333
332
  //# sourceMappingURL=wire-scope.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wire-scope.js","sources":["../../../../../../../../src/wirestate-core/container/wire-scope.ts"],"sourcesContent":[null],"names":["WireScope","container","isDisposed","prototype","getContainer","WirestateError","ERROR_CODE_ACCESS_AFTER_DISPOSAL","ERROR_CODE_ACCESS_BEFORE_ACTIVATION","resolve","injectionId","get","resolveOptional","isBound","emitEvent","type","payload","from","EventBus","emit","undefined","subscribeToEvent","handler","subscribe","unsubscribeFromEvent","unsubscribe","queryData","data","QueryBus","query","queryOptionalData","queryOptional","registerQueryHandler","register","unregisterQueryHandler","unregister","executeCommand","CommandBus","command","executeOptionalCommand","commandOptional","registerCommandHandler","unregisterCommandHandler","getSeed","seed","SEEDS_TOKEN","SEED_TOKEN","__decorate","injectable"],"mappings":";;;;;;;;;AAiBA;;;;;;;;;;AAUG;AAEH,IAAAA,SAAA,gBAAA,YAAA;EAME,SAAAA,SAAAA,CAAoCC,SAA8B,EAAA;IAA9B,IAAA,CAAAA,SAAS,GAATA,SAAS;AAL7C;;AAEG;IACa,IAAA,CAAAC,UAAU,GAAY,KAAK;AAE0B,EAAA;AAErE;;;;;;;;;;;;;AAaG;AACIF,EAAAA,SAAA,CAAAG,SAAA,CAAAC,YAAY,GAAnB,YAAA;IACE,IAAI,IAAI,CAACH,SAAS,EAAE;MAClB,OAAO,IAAI,CAACA,SAAS;AACvB,IAAA;IAEA,IAAI,IAAI,CAACC,UAAU,EAAE;AACnB,MAAA,MAAM,IAAIG,cAAc,CACtBC,gCAAgC,EAChC,wFAAwF,CACzF;AACH,IAAA,CAAC,MAAM;MACL,MAAM,IAAID,cAAc,CACtBE,mCAAmC,EACnC,mDAAmD,GACjD,gEAAgE,CACnE;AACH,IAAA;EACF,CAA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{"version":3,"file":"wire-scope.js","sources":["../../../../../../../../src/wirestate-core/container/wire-scope.ts"],"sourcesContent":[null],"names":["WireScope","isDisposed","constructor","container","getContainer","WirestateError","ERROR_CODE_ACCESS_AFTER_DISPOSAL","ERROR_CODE_ACCESS_BEFORE_ACTIVATION","resolve","injectionId","get","resolveOptional","isBound","emitEvent","type","payload","from","EventBus","emit","undefined","subscribeToEvent","handler","subscribe","unsubscribeFromEvent","unsubscribe","queryData","data","QueryBus","query","queryOptionalData","queryOptional","registerQueryHandler","register","unregisterQueryHandler","unregister","executeCommand","CommandBus","command","executeOptionalCommand","commandOptional","registerCommandHandler","unregisterCommandHandler","getSeed","seed","SEEDS_TOKEN","SEED_TOKEN","__decorate","injectable"],"mappings":";;;;;;;;;AAiBA;;;;;;;;;;AAUG;AAEI,IAAMA,SAAS,GAAf,MAAMA,SAAS,CAAA;AACpB;;AAEG;AACaC,EAAAA,UAAU,GAAY,KAAK;EAE3CC,WAAAA,CAAoCC,SAA8B,EAAA;IAA9B,IAAA,CAAAA,SAAS,GAATA,SAAS;AAAwB,EAAA;AAErE;;;;;;;;;;;;;AAaG;AACIC,EAAAA,YAAYA,GAAA;IACjB,IAAI,IAAI,CAACD,SAAS,EAAE;MAClB,OAAO,IAAI,CAACA,SAAS;AACvB,IAAA;IAEA,IAAI,IAAI,CAACF,UAAU,EAAE;AACnB,MAAA,MAAM,IAAII,cAAc,CACtBC,gCAAgC,EAChC,wFAAwF,CACzF;AACH,IAAA,CAAC,MAAM;MACL,MAAM,IAAID,cAAc,CACtBE,mCAAmC,EACnC,mDAAmD,GACjD,gEAAgE,CACnE;AACH,IAAA;AACF,EAAA;AAEA;;;;;;;;;;;;;;;;;;AAkBG;EACIC,OAAOA,CAAIC,WAAiC,EAAA;IAMjD,OAAO,IAAI,CAACL,YAAY,EAAE,CAACM,GAAG,CAAID,WAAW,CAAC;AAChD,EAAA;AAEA;;;;;;;;;;;;;;;;AAgBG;EACIE,eAAeA,CAAIF,WAAiC,E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B,IAAiB,EAAEO,OAA6B,EAAA;AAGxG,IAAA,IAAI,CAACjB,YAAY,EAAE,CAACM,GAAG,CAAC0B,UAAU,CAAC,CAACF,UAAU,CAACpB,IAAI,EAAEO,OAAO,CAAC;AAC/D,EAAA;EA2COqB,OAAOA,CAAIC,IAAc,EAAA;AAK9B,IAAA,OAAOA,IAAI,GACN,IAAI,CAACvC,YAAY,EAAE,CAACM,GAAG,CAAWkC,WAAW,CAAC,CAAClC,GAAG,CAACiC,IAAI,CAAO,IAAI,IAAI,GACvE,IAAI,CAACvC,YAAY,EAAE,CAACM,GAAG,CAAImC,UAAU,CAAC;AAC5C,EAAA;;AA1aW7C,SAAS,GAAA8C,UAAA,CAAA,CADrBC,UAAU,EAAE,4CACA,EAAA/C,SAAS,CA2arB;;;;"}
@@ -1,11 +1,11 @@
1
- var ERROR_CODE_GENERIC = 1;
2
- var ERROR_CODE_VALIDATION_ERROR = 50;
3
- var ERROR_CODE_INVALID_ARGUMENTS = 51;
4
- var ERROR_CODE_BINDING_SCOPE = 52;
5
- var ERROR_CODE_FAILED_TO_RESOLVE_QUERY_HANDLER = 101;
6
- var ERROR_CODE_FAILED_TO_RESOLVE_COMMAND_HANDLER = 102;
7
- var ERROR_CODE_ACCESS_BEFORE_ACTIVATION = 200;
8
- var ERROR_CODE_ACCESS_AFTER_DISPOSAL = 201;
1
+ const ERROR_CODE_GENERIC = 1;
2
+ const ERROR_CODE_VALIDATION_ERROR = 50;
3
+ const ERROR_CODE_INVALID_ARGUMENTS = 51;
4
+ const ERROR_CODE_BINDING_SCOPE = 52;
5
+ const ERROR_CODE_FAILED_TO_RESOLVE_QUERY_HANDLER = 101;
6
+ const ERROR_CODE_FAILED_TO_RESOLVE_COMMAND_HANDLER = 102;
7
+ const ERROR_CODE_ACCESS_BEFORE_ACTIVATION = 200;
8
+ const ERROR_CODE_ACCESS_AFTER_DISPOSAL = 201;
9
9
 
10
10
  export { ERROR_CODE_ACCESS_AFTER_DISPOSAL, ERROR_CODE_ACCESS_BEFORE_ACTIVATION, ERROR_CODE_BINDING_SCOPE, ERROR_CODE_FAILED_TO_RESOLVE_COMMAND_HANDLER, ERROR_CODE_FAILED_TO_RESOLVE_QUERY_HANDLER, ERROR_CODE_GENERIC, ERROR_CODE_INVALID_ARGUMENTS, ERROR_CODE_VALIDATION_ERROR };
11
11
  //# sourceMappingURL=error-code.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-code.js","sources":["../../../../../../../../src/wirestate-core/error/error-code.ts"],"sourcesContent":[null],"names":["ERROR_CODE_GENERIC","ERROR_CODE_VALIDATION_ERROR","ERROR_CODE_INVALID_ARGUMENTS","ERROR_CODE_BINDING_SCOPE","ERROR_CODE_FAILED_TO_RESOLVE_QUERY_HANDLER","ERROR_CODE_FAILED_TO_RESOLVE_COMMAND_HANDLER","ERROR_CODE_ACCESS_BEFORE_ACTIVATION","ERROR_CODE_ACCESS_AFTER_DISPOSAL"],"mappings":"AAAO,IAAMA,kBAAkB,GAAW;AAEnC,IAAMC,2BAA2B,GAAW;AAC5C,IAAMC,4BAA4B,GAAW;AAC7C,IAAMC,wBAAwB,GAAW;AAGzC,IAAMC,0CAA0C,GAAW;AAC3D,IAAMC,4CAA4C,GAAW;AAE7D,IAAMC,mCAAmC,GAAW;AACpD,IAAMC,gCAAgC,GAAW;;;;"}
1
+ {"version":3,"file":"error-code.js","sources":["../../../../../../../../src/wirestate-core/error/error-code.ts"],"sourcesContent":[null],"names":["ERROR_CODE_GENERIC","ERROR_CODE_VALIDATION_ERROR","ERROR_CODE_INVALID_ARGUMENTS","ERROR_CODE_BINDING_SCOPE","ERROR_CODE_FAILED_TO_RESOLVE_QUERY_HANDLER","ERROR_CODE_FAILED_TO_RESOLVE_COMMAND_HANDLER","ERROR_CODE_ACCESS_BEFORE_ACTIVATION","ERROR_CODE_ACCESS_AFTER_DISPOSAL"],"mappings":"AAAO,MAAMA,kBAAkB,GAAW;AAEnC,MAAMC,2BAA2B,GAAW;AAC5C,MAAMC,4BAA4B,GAAW;AAC7C,MAAMC,wBAAwB,GAAW;AAGzC,MAAMC,0CAA0C,GAAW;AAC3D,MAAMC,4CAA4C,GAAW;AAE7D,MAAMC,mCAAmC,GAAW;AACpD,MAAMC,gCAAgC,GAAW;;;;"}
@@ -1,4 +1,3 @@
1
- import { __extends } from 'tslib';
2
1
  import { ERROR_CODE_GENERIC } from './error-code.js';
3
2
 
4
3
  /**
@@ -22,29 +21,31 @@ import { ERROR_CODE_GENERIC } from './error-code.js';
22
21
  * }
23
22
  * ```
24
23
  */
25
- var WirestateError = /** @class */function (_super) {
26
- __extends(WirestateError, _super);
24
+ class WirestateError extends Error {
25
+ /**
26
+ * The name of the error class, useful for identification in minified environments.
27
+ */
28
+ name = "WirestateError";
29
+ /**
30
+ * Numeric error code identifying the specific failure type.
31
+ */
32
+
33
+ /**
34
+ * Human-readable description of the error.
35
+ */
36
+
27
37
  /**
28
38
  * Creates a new instance of WirestateError.
29
39
  *
30
40
  * @param code - Numeric identifier for the error (defaults to ERROR_CODE_GENERIC).
31
41
  * @param detail - Optional descriptive message.
32
42
  */
33
- function WirestateError(code, detail) {
34
- if (code === void 0) {
35
- code = ERROR_CODE_GENERIC;
36
- }
37
- var _this = _super.call(this) || this;
38
- /**
39
- * The name of the error class, useful for identification in minified environments.
40
- */
41
- _this.name = "WirestateError";
42
- _this.code = code;
43
- _this.message = detail || "Wirestate error.";
44
- return _this;
43
+ constructor(code = ERROR_CODE_GENERIC, detail) {
44
+ super();
45
+ this.code = code;
46
+ this.message = detail || "Wirestate error.";
45
47
  }
46
- return WirestateError;
47
- }(Error);
48
+ }
48
49
 
49
50
  export { WirestateError };
50
51
  //# sourceMappingURL=wirestate-error.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"wirestate-error.js","sources":["../../../../../../../../src/wirestate-core/error/wirestate-error.ts"],"sourcesContent":[null],"names":["WirestateError","_super","__extends","code","detail","ERROR_CODE_GENERIC","_this","name","message","Error"],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;;;AAoBG;AACH,IAAAA,cAAA,gBAAA,UAAAC,MAAA,EAAA;AAAoCC,EAAAA,SAAA,CAAAF,cAAA,EAAAC,MAAA,CAAA;AAclC;;;;;AAKG;AACH,EAAA,SAAAD,cAAAA,CAAmBG,IAAiC,EAAEC,MAAe,EAAA;AAAlD,IAAA,IAAAD,IAAA,KAAA,MAAA,EAAA;AAAAA,MAAAA,IAAA,GAAAE,kBAAiC;AAAA,IAAA;IAClD,IAAAC,KAAA,GAAAL,MAAK,WAAE,IAAA,IAAA;AApBT;;AAEG;IACaK,KAAA,CAAAC,IAAI,GAAW,gBAAgB;IAmB7CD,KAAI,CAACH,IAAI,GAAGA,IAAI;AAChBG,IAAAA,KAAI,CAACE,OAAO,GAAGJ,MAAM,IAAI,kBAAkB;;AAC7C,EAAA;AACF,EAAA,OAAAJ,cAAC;AAAD,CA1BA,CAAoCS,KAAK;;;;"}
1
+ {"version":3,"file":"wirestate-error.js","sources":["../../../../../../../../src/wirestate-core/error/wirestate-error.ts"],"sourcesContent":[null],"names":["WirestateError","Error","name","constructor","code","ERROR_CODE_GENERIC","detail","message"],"mappings":";;AAEA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,MAAOA,cAAe,SAAQC,KAAK,CAAA;AACvC;;AAEG;AACaC,EAAAA,IAAI,GAAW,gBAAgB;AAC/C;;AAEG;;AAEH;;AAEG;;AAGH;;;;;AAKG;AACHC,EAAAA,WAAAA,CAAmBC,IAAA,GAAeC,kBAAkB,EAAEC,MAAe,EAAA;AACnE,IAAA,KAAK,EAAE;IAEP,IAAI,CAACF,IAAI,GAAGA,IAAI;AAChB,IAAA,IAAI,CAACG,OAAO,GAAGD,MAAM,IAAI,kBAAkB;AAC7C,EAAA;AACD;;;;"}
@@ -26,11 +26,10 @@ import { getEventHandlerMetadata } from './get-event-handler-metadata.js';
26
26
  * ```
27
27
  */
28
28
  function buildEventDispatcher(instance) {
29
- var entries = [];
29
+ const entries = [];
30
30
  // Register methods decorated with @OnEvent.
31
- for (var _i = 0, _a = getEventHandlerMetadata(instance); _i < _a.length; _i++) {
32
- var meta = _a[_i];
33
- var method = instance[meta.methodName];
31
+ for (const meta of getEventHandlerMetadata(instance)) {
32
+ const method = instance[meta.methodName];
34
33
  if (typeof method === "function") {
35
34
  entries.push({
36
35
  types: meta.types,
@@ -39,10 +38,9 @@ function buildEventDispatcher(instance) {
39
38
  }
40
39
  }
41
40
  if (entries.length) {
42
- return function (event) {
41
+ return event => {
43
42
  // Fan out events to all matching handlers.
44
- for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
45
- var entry = entries_1[_i];
43
+ for (const entry of entries) {
46
44
  if (entry.types === null || entry.types.includes(event.type)) {
47
45
  entry.handler(event);
48
46
  }
@@ -1 +1 @@
1
- {"version":3,"file":"build-event-dispatcher.js","sources":["../../../../../../../../src/wirestate-core/events/build-event-dispatcher.ts"],"sourcesContent":[null],"names":["buildEventDispatcher","instance","entries","_i","_a","getEventHandlerMetadata","length","meta","method","methodName","push","types","handler","bind","event","entries_1","entry","includes","type"],"mappings":";;AAQA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACG,SAAUA,oBAAoBA,CAAmBC,QAAW,EAAA;EAGhE,IAAMC,OAAO,GAA8B,EAAE;AAE7C;EACA,KAAmB,IAAAC,EAAA,GAAA,CAAiC,EAAjCC,EAAA,GAAAC,uBAAuB,CAACJ,QAAQ,CAAC,EAAjCE,EAAA,GAAAC,EAAA,CAAAE,MAAiC,EAAjCH,EAAA,EAAiC,EAAE;AAAjD,IAAA,IAAMI,IAAI,GAAAH,EAAA,CAAAD,EAAA,CAAA;AACb,IAAA,IAAMK,MAAM,GAAIP,QAAwD,CAACM,IAAI,CAACE,UAAU,CAAC;AAEzF,IAAA,IAAI,OAAOD,MAAM,KAAK,UAAU,EAAE;MAChCN,OAAO,CAACQ,IAAI,CAAC;QACXC,KAAK,EAAEJ,IAAI,CAACI,KAAK;AACjBC,QAAAA,OAAO,EAAGJ,MAAuB,CAACK,IAAI,CAACZ,QAAQ;AAChD,OAAA,CAAC;AACJ,IAAA;AACF,EAAA;EAEA,IAAIC,OAAO,CAACI,MAAM,EAAE;IAOlB,OAAO,UAACQ,KAAK,EAAA;AACX;AACA,MAAA,KAAoB,IAAAX,EAAA,GAAA,CAAO,EAAPY,SAAA,GAAAb,OAAO,EAAPC,qBAAO,EAAPA,EAAA,EAAO,EAAE;AAAxB,QAAA,IAAMa,KAAK,GAAAD,SAAA,CAAAZ,EAAA,CAAA;AACd,QAAA,IAAIa,KAAK,CAACL,KAAK,KAAK,IAAI,IAAIK,KAAK,CAACL,KAAK,CAACM,QAAQ,CAACH,KAAK,CAACI,IAAI,CAAC,EAAE;AAC5DF,UAAAA,KAAK,CAACJ,OAAO,CAACE,KAAK,CAAC;AACtB,QAAA;AACF,MAAA;IACF,CAAC;AACH,EAAA,CAAC,MAAM;AAOL,IAAA,OAAO,IAAI;AACb,EAAA;AACF;;;;"}
1
+ {"version":3,"file":"build-event-dispatcher.js","sources":["../../../../../../../../src/wirestate-core/events/build-event-dispatcher.ts"],"sourcesContent":[null],"names":["buildEventDispatcher","instance","entries","meta","getEventHandlerMetadata","method","methodName","push","types","handler","bind","length","event","entry","includes","type"],"mappings":";;AAQA;;;;;;;;;;;;;;;;;;;;;;;;AAwBG;AACG,SAAUA,oBAAoBA,CAAmBC,QAAW,EAAA;EAGhE,MAAMC,OAAO,GAA8B,EAAE;AAE7C;AACA,EAAA,KAAK,MAAMC,IAAI,IAAIC,uBAAuB,CAACH,QAAQ,CAAC,EAAE;AACpD,IAAA,MAAMI,MAAM,GAAIJ,QAAwD,CAACE,IAAI,CAACG,UAAU,CAAC;AAEzF,IAAA,IAAI,OAAOD,MAAM,KAAK,UAAU,EAAE;MAChCH,OAAO,CAACK,IAAI,CAAC;QACXC,KAAK,EAAEL,IAAI,CAACK,KAAK;AACjBC,QAAAA,OAAO,EAAGJ,MAAuB,CAACK,IAAI,CAACT,QAAQ;AAChD,OAAA,CAAC;AACJ,IAAA;AACF,EAAA;EAEA,IAAIC,OAAO,CAACS,MAAM,EAAE;AAOlB,IAAA,OAAQC,KAAK,IAAI;AACf;AACA,MAAA,KAAK,MAAMC,KAAK,IAAIX,OAAO,EAAE;AAC3B,QAAA,IAAIW,KAAK,CAACL,KAAK,KAAK,IAAI,IAAIK,KAAK,CAACL,KAAK,CAACM,QAAQ,CAACF,KAAK,CAACG,IAAI,CAAC,EAAE;AAC5DF,UAAAA,KAAK,CAACJ,OAAO,CAACG,KAAK,CAAC;AACtB,QAAA;AACF,MAAA;IACF,CAAC;AACH,EAAA,CAAC,MAAM;AAOL,IAAA,OAAO,IAAI;AACb,EAAA;AACF;;;;"}
@@ -23,9 +23,9 @@ import { EventBus } from './event-bus.js';
23
23
  */
24
24
  function emitEvent(container, type, payload, from) {
25
25
  container.get(EventBus).emit({
26
- type: type,
27
- payload: payload,
28
- from: from
26
+ type,
27
+ payload,
28
+ from
29
29
  });
30
30
  }
31
31
 
@@ -1 +1 @@
1
- {"version":3,"file":"emit-event.js","sources":["../../../../../../../../src/wirestate-core/events/emit-event.ts"],"sourcesContent":[null],"names":["emitEvent","container","type","payload","from","get","EventBus","emit"],"mappings":";;AASA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAUA,SAASA,CAAyBC,SAAoB,EAAEC,IAAO,EAAEC,OAAW,EAAEC,IAAc,EAAA;AAG1GH,EAAAA,SAAS,CAACI,GAAG,CAACC,QAAQ,CAAC,CAACC,IAAI,CAAC;AAAEL,IAAAA,IAAI,EAAAA,IAAA;AAAEC,IAAAA,OAAO,EAAAA,OAAA;AAAEC,IAAAA,IAAI,EAAAA;AAAA,GAAE,CAAC;AACvD;;;;"}
1
+ {"version":3,"file":"emit-event.js","sources":["../../../../../../../../src/wirestate-core/events/emit-event.ts"],"sourcesContent":[null],"names":["emitEvent","container","type","payload","from","get","EventBus","emit"],"mappings":";;AASA;;;;;;;;;;;;;;;;;;;;AAoBG;AACG,SAAUA,SAASA,CAAyBC,SAAoB,EAAEC,IAAO,EAAEC,OAAW,EAAEC,IAAc,EAAA;AAG1GH,EAAAA,SAAS,CAACI,GAAG,CAACC,QAAQ,CAAC,CAACC,IAAI,CAAC;IAAEL,IAAI;IAAEC,OAAO;AAAEC,IAAAA;AAAI,GAAE,CAAC;AACvD;;;;"}
@@ -8,10 +8,8 @@
8
8
  *
9
9
  * @group Events
10
10
  */
11
- var EventBus = /** @class */function () {
12
- function EventBus() {
13
- this.handlers = new Set();
14
- }
11
+ class EventBus {
12
+ handlers = new Set();
15
13
  /**
16
14
  * Broadcasts an event to all registered subscribers.
17
15
  *
@@ -34,11 +32,10 @@ var EventBus = /** @class */function () {
34
32
  * });
35
33
  * ```
36
34
  */
37
- EventBus.prototype.emit = function (event) {
35
+ emit(event) {
38
36
  // Snapshot prevents concurrent modification errors if handlers sub/unsub during emit.
39
- var snapshot = Array.from(this.handlers);
40
- for (var _i = 0, snapshot_1 = snapshot; _i < snapshot_1.length; _i++) {
41
- var handler = snapshot_1[_i];
37
+ const snapshot = Array.from(this.handlers);
38
+ for (const handler of snapshot) {
42
39
  try {
43
40
  handler(event);
44
41
  } catch (error) {
@@ -46,7 +43,7 @@ var EventBus = /** @class */function () {
46
43
  console.error("[wirestate] Event handler threw:", error);
47
44
  }
48
45
  }
49
- };
46
+ }
50
47
  /**
51
48
  * Registers a handler to receive all broadcasted events.
52
49
  *
@@ -60,13 +57,10 @@ var EventBus = /** @class */function () {
60
57
  * });
61
58
  * ```
62
59
  */
63
- EventBus.prototype.subscribe = function (handler) {
64
- var _this = this;
60
+ subscribe(handler) {
65
61
  this.handlers.add(handler);
66
- return function () {
67
- return _this.unsubscribe(handler);
68
- };
69
- };
62
+ return () => this.unsubscribe(handler);
63
+ }
70
64
  /**
71
65
  * Removes a previously registered event handler.
72
66
  *
@@ -75,27 +69,26 @@ var EventBus = /** @class */function () {
75
69
  *
76
70
  * @param handler - The handler function instance to remove.
77
71
  */
78
- EventBus.prototype.unsubscribe = function (handler) {
72
+ unsubscribe(handler) {
79
73
  this.handlers.delete(handler);
80
- };
74
+ }
81
75
  /**
82
76
  * Checks if the bus has any active subscribers.
83
77
  *
84
78
  * @returns `true` if at least one handler is registered, `false` otherwise.
85
79
  */
86
- EventBus.prototype.has = function () {
80
+ has() {
87
81
  return this.handlers.size > 0;
88
- };
82
+ }
89
83
  /**
90
84
  * Removes all registered handlers from the bus.
91
85
  *
92
86
  * @internal
93
87
  */
94
- EventBus.prototype.clear = function () {
88
+ clear() {
95
89
  this.handlers.clear();
96
- };
97
- return EventBus;
98
- }();
90
+ }
91
+ }
99
92
 
100
93
  export { EventBus };
101
94
  //# sourceMappingURL=event-bus.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"event-bus.js","sources":["../../../../../../../../src/wirestate-core/events/event-bus.ts"],"sourcesContent":[null],"names":["EventBus","handlers","Set","prototype","emit","event","snapshot","Array","from","_i","snapshot_1","handler","error","console","subscribe","_this","add","unsubscribe","delete","has","size","clear"],"mappings":"AAKA;;;;;;;;;AASG;AACH,IAAAA,QAAA,gBAAA,YAAA;EAAA,SAAAA,QAAAA,GAAA;AACmB,IAAA,IAAA,CAAAC,QAAQ,GAAsB,IAAIC,GAAG,EAAE;AAgG1D,EAAA;AA9FE;;;;;;;;;;;;;;;;;;;;;AAqBG;AACIF,EAAAA,QAAA,CAAAG,SAAA,CAAAC,IAAI,GAAX,UAAuEC,KAAqB,EAAA;AAC1F;IACA,IAAMC,QAAQ,GAAwBC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACP,QAAQ,CAAC;AAE/D,IAAA,KAAsB,IAAAQ,EAAA,GAAA,CAAQ,EAARC,UAAA,GAAAJ,QAAQ,EAARG,sBAAQ,EAARA,EAAA,EAAQ,EAAE;AAA3B,MAAA,IAAME,OAAO,GAAAD,UAAA,CAAAD,EAAA,CAAA;MAChB,IAAI;QACFE,OAAO,CAACN,KAAK,CAAC;MAChB,CAAC,CAAC,OAAOO,KAAK,EAAE;AACd;AACAC,QAAAA,OAAO,CAACD,KAAK,CAAC,kCAAkC,EAAEA,KAAK,CAAC;AAC1D,MAAA;AACF,IAAA;EACF,CAAC;AAED;;;;;;;;;;;;AAYG;AACIZ,EAAAA,QAAA,CAAAG,SAAA,CAAAW,SAAS,GAAhB,UAAiBH,OAAqB,EAAA;IAAtC,IAAAI,KAAA,GAAA,IAAA;AAME,IAAA,IAAI,CAACd,QAAQ,CAACe,GAAG,CAACL,OAAO,CAAC;AAE1B,IAAA,OAAO,YAAA;AAAM,MAAA,OAAAI,KAAI,CAACE,WAAW,CAACN,OAAO,CAAC;IAAzB,CAAyB;EACxC,CAAC;AAED;;;;;;;AAOG;AACIX,EAAAA,QAAA,CAAAG,SAAA,CAAAc,WAAW,GAAlB,UAAmBN,OAAqB,EAAA;AAMtC,IAAA,IAAI,CAACV,QAAQ,CAACiB,MAAM,CAACP,OAAO,CAAC;EAC/B,CAAC;AAED;;;;AAIG;AACIX,EAAAA,QAAA,CAAAG,SAAA,CAAAgB,GAAG,GAAV,YAAA;AACE,IAAA,OAAO,IAAI,CAAClB,QAAQ,CAACmB,IAAI,GAAG,CAAC;EAC/B,CAAC;AAED;;;;AAIG;AACIpB,EAAAA,QAAA,CAAAG,SAAA,CAAAkB,KAAK,GAAZ,YAAA;AACE,IAAA,IAAI,CAACpB,QAAQ,CAACoB,KAAK,EAAE;EACvB,CAAC;AACH,EAAA,OAAArB,QAAC;AAAD,CAAC;;;;"}
1
+ {"version":3,"file":"event-bus.js","sources":["../../../../../../../../src/wirestate-core/events/event-bus.ts"],"sourcesContent":[null],"names":["EventBus","handlers","Set","emit","event","snapshot","Array","from","handler","error","console","subscribe","add","unsubscribe","delete","has","size","clear"],"mappings":"AAKA;;;;;;;;;AASG;MACUA,QAAQ,CAAA;AACFC,EAAAA,QAAQ,GAAsB,IAAIC,GAAG,EAAE;AAExD;;;;;;;;;;;;;;;;;;;;;AAqBG;EACIC,IAAIA,CAA4DC,KAAqB,EAAA;AAC1F;IACA,MAAMC,QAAQ,GAAwBC,KAAK,CAACC,IAAI,CAAC,IAAI,CAACN,QAAQ,CAAC;AAE/D,IAAA,KAAK,MAAMO,OAAO,IAAIH,QAAQ,EAAE;MAC9B,IAAI;QACFG,OAAO,CAACJ,KAAK,CAAC;MAChB,CAAC,CAAC,OAAOK,KAAK,EAAE;AACd;AACAC,QAAAA,OAAO,CAACD,KAAK,CAAC,kCAAkC,EAAEA,KAAK,CAAC;AAC1D,MAAA;AACF,IAAA;AACF,EAAA;AAEA;;;;;;;;;;;;AAYG;EACIE,SAASA,CAACH,OAAqB,EAAA;AAMpC,IAAA,IAAI,CAACP,QAAQ,CAACW,GAAG,CAACJ,OAAO,CAAC;AAE1B,IAAA,OAAO,MAAM,IAAI,CAACK,WAAW,CAACL,OAAO,CAAC;AACxC,EAAA;AAEA;;;;;;;AAOG;EACIK,WAAWA,CAACL,OAAqB,EAAA;AAMtC,IAAA,IAAI,CAACP,QAAQ,CAACa,MAAM,CAACN,OAAO,CAAC;AAC/B,EAAA;AAEA;;;;AAIG;AACIO,EAAAA,GAAGA,GAAA;AACR,IAAA,OAAO,IAAI,CAACd,QAAQ,CAACe,IAAI,GAAG,CAAC;AAC/B,EAAA;AAEA;;;;AAIG;AACIC,EAAAA,KAAKA,GAAA;AACV,IAAA,IAAI,CAAChB,QAAQ,CAACgB,KAAK,EAAE;AACvB,EAAA;AACD;;;;"}
@@ -24,11 +24,11 @@ import { EVENT_HANDLER_METADATA } from '../registry.js';
24
24
  * ```
25
25
  */
26
26
  function getEventHandlerMetadata(instance) {
27
- var constructor = instance.constructor;
28
- var chain = [];
27
+ let constructor = instance.constructor;
28
+ const chain = [];
29
29
  // Traverse prototype chain up to Object/Function
30
30
  while (typeof constructor === "function" && constructor !== Object && constructor !== Function.prototype) {
31
- var own = EVENT_HANDLER_METADATA.get(constructor);
31
+ const own = EVENT_HANDLER_METADATA.get(constructor);
32
32
  if (own && own.length > 0) {
33
33
  chain.push(own);
34
34
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-event-handler-metadata.js","sources":["../../../../../../../../src/wirestate-core/events/get-event-handler-metadata.ts"],"sourcesContent":[null],"names":["getEventHandlerMetadata","instance","constructor","chain","Object","Function","prototype","own","EVENT_HANDLER_METADATA","get","length","push","getPrototypeOf","reverse","flat"],"mappings":";;AAOA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACG,SAAUA,uBAAuBA,CAACC,QAAgB,EAAA;AAGtD,EAAA,IAAIC,WAAW,GAAYD,QAAQ,CAACC,WAAW;EAE/C,IAAMC,KAAK,GAAuC,EAAE;AAEpD;AACA,EAAA,OAAO,OAAOD,WAAW,KAAK,UAAU,IAAIA,WAAW,KAAKE,MAAM,IAAIF,WAAW,KAAKG,QAAQ,CAACC,SAAS,EAAE;AACxG,IAAA,IAAMC,GAAG,GAAuCC,sBAAsB,CAACC,GAAG,CAACP,WAAqB,CAAC;AAEjG,IAAA,IAAIK,GAAG,IAAIA,GAAG,CAACG,MAAM,GAAG,CAAC,EAAE;AACzBP,MAAAA,KAAK,CAACQ,IAAI,CAACJ,GAAG,CAAC;AACjB,IAAA;AAEAL,IAAAA,WAAW,GAAGE,MAAM,CAACQ,cAAc,CAACV,WAAW,CAAC;AAClD,EAAA;AAQA;EACA,OAAOC,KAAK,CAACU,OAAO,EAAE,CAACC,IAAI,EAAE;AAC/B;;;;"}
1
+ {"version":3,"file":"get-event-handler-metadata.js","sources":["../../../../../../../../src/wirestate-core/events/get-event-handler-metadata.ts"],"sourcesContent":[null],"names":["getEventHandlerMetadata","instance","constructor","chain","Object","Function","prototype","own","EVENT_HANDLER_METADATA","get","length","push","getPrototypeOf","reverse","flat"],"mappings":";;AAOA;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACG,SAAUA,uBAAuBA,CAACC,QAAgB,EAAA;AAGtD,EAAA,IAAIC,WAAW,GAAYD,QAAQ,CAACC,WAAW;EAE/C,MAAMC,KAAK,GAAuC,EAAE;AAEpD;AACA,EAAA,OAAO,OAAOD,WAAW,KAAK,UAAU,IAAIA,WAAW,KAAKE,MAAM,IAAIF,WAAW,KAAKG,QAAQ,CAACC,SAAS,EAAE;AACxG,IAAA,MAAMC,GAAG,GAAuCC,sBAAsB,CAACC,GAAG,CAACP,WAAqB,CAAC;AAEjG,IAAA,IAAIK,GAAG,IAAIA,GAAG,CAACG,MAAM,GAAG,CAAC,EAAE;AACzBP,MAAAA,KAAK,CAACQ,IAAI,CAACJ,GAAG,CAAC;AACjB,IAAA;AAEAL,IAAAA,WAAW,GAAGE,MAAM,CAACQ,cAAc,CAACV,WAAW,CAAC;AAClD,EAAA;AAQA;EACA,OAAOC,KAAK,CAACU,OAAO,EAAE,CAACC,IAAI,EAAE;AAC/B;;;;"}
@@ -1,4 +1,3 @@
1
- import { __spreadArray } from 'tslib';
2
1
  import { EVENT_HANDLER_METADATA } from '../registry.js';
3
2
 
4
3
  /**
@@ -38,10 +37,10 @@ import { EVENT_HANDLER_METADATA } from '../registry.js';
38
37
  */
39
38
  function OnEvent(types) {
40
39
  // Normalize types to an array or null for catch-all.
41
- var normalized = types === undefined ? null : Array.isArray(types) ? __spreadArray([], types, true) : [types];
42
- return function (target, propertyKey) {
43
- var constructor = target.constructor;
44
- var list = EVENT_HANDLER_METADATA.get(constructor);
40
+ const normalized = types === undefined ? null : Array.isArray(types) ? [...types] : [types];
41
+ return (target, propertyKey) => {
42
+ const constructor = target.constructor;
43
+ let list = EVENT_HANDLER_METADATA.get(constructor);
45
44
  if (!list) {
46
45
  list = [];
47
46
  EVENT_HANDLER_METADATA.set(constructor, list);
@@ -1 +1 @@
1
- {"version":3,"file":"on-event.js","sources":["../../../../../../../../src/wirestate-core/events/on-event.ts"],"sourcesContent":[null],"names":["OnEvent","types","normalized","undefined","Array","isArray","__spreadArray","target","propertyKey","constructor","list","EVENT_HANDLER_METADATA","get","set","push","methodName"],"mappings":";;;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACG,SAAUA,OAAOA,CAACC,KAA4C,EAAA;AAClE;EACA,IAAMC,UAAU,GACdD,KAAK,KAAKE,SAAS,GAAG,IAAI,GAAGC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,GAAEK,aAAA,CAAA,EAAA,EAAML,KAAkC,EAAA,IAAA,CAAA,GAAI,CAACA,KAAkB,CAAC;AAErH,EAAA,OAAO,UAACM,MAAM,EAAEC,WAAW,EAAA;AASzB,IAAA,IAAMC,WAAW,GAAGF,MAAM,CAACE,WAAW;AAEtC,IAAA,IAAIC,IAAI,GAAuCC,sBAAsB,CAACC,GAAG,CAACH,WAAW,CAAC;IAEtF,IAAI,CAACC,IAAI,EAAE;AACTA,MAAAA,IAAI,GAAG,EAAE;AACTC,MAAAA,sBAAsB,CAACE,GAAG,CAACJ,WAAW,EAAEC,IAAI,CAAC;AAC/C,IAAA;AAEA;IACAA,IAAI,CAACI,IAAI,CAAC;AAAEC,MAAAA,UAAU,EAAEP,WAAW;AAAEP,MAAAA,KAAK,EAAEC;AAAU,KAAE,CAAC;EAC3D,CAAC;AACH;;;;"}
1
+ {"version":3,"file":"on-event.js","sources":["../../../../../../../../src/wirestate-core/events/on-event.ts"],"sourcesContent":[null],"names":["OnEvent","types","normalized","undefined","Array","isArray","target","propertyKey","constructor","list","EVENT_HANDLER_METADATA","get","set","push","methodName"],"mappings":";;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACG,SAAUA,OAAOA,CAACC,KAA4C,EAAA;AAClE;EACA,MAAMC,UAAU,GACdD,KAAK,KAAKE,SAAS,GAAG,IAAI,GAAGC,KAAK,CAACC,OAAO,CAACJ,KAAK,CAAC,GAAG,CAAC,GAAIA,KAAkC,CAAC,GAAG,CAACA,KAAkB,CAAC;AAErH,EAAA,OAAO,CAACK,MAAM,EAAEC,WAAW,KAAI;AAS7B,IAAA,MAAMC,WAAW,GAAGF,MAAM,CAACE,WAAW;AAEtC,IAAA,IAAIC,IAAI,GAAuCC,sBAAsB,CAACC,GAAG,CAACH,WAAW,CAAC;IAEtF,IAAI,CAACC,IAAI,EAAE;AACTA,MAAAA,IAAI,GAAG,EAAE;AACTC,MAAAA,sBAAsB,CAACE,GAAG,CAACJ,WAAW,EAAEC,IAAI,CAAC;AAC/C,IAAA;AAEA;IACAA,IAAI,CAACI,IAAI,CAAC;AAAEC,MAAAA,UAAU,EAAEP,WAAW;AAAEN,MAAAA,KAAK,EAAEC;AAAU,KAAE,CAAC;EAC3D,CAAC;AACH;;;;"}
@@ -25,11 +25,11 @@ import { QUERY_HANDLER_METADATA } from '../registry.js';
25
25
  * ```
26
26
  */
27
27
  function getQueryHandlerMetadata(instance) {
28
- var constructor = instance.constructor;
29
- var chain = [];
28
+ let constructor = instance.constructor;
29
+ const chain = [];
30
30
  // Traverse prototype chain up to Object/Function
31
31
  while (typeof constructor === "function" && constructor !== Object && constructor !== Function.prototype) {
32
- var own = QUERY_HANDLER_METADATA.get(constructor);
32
+ const own = QUERY_HANDLER_METADATA.get(constructor);
33
33
  if (own && own.length > 0) {
34
34
  chain.push(own);
35
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-query-handler-metadata.js","sources":["../../../../../../../../src/wirestate-core/queries/get-query-handler-metadata.ts"],"sourcesContent":[null],"names":["getQueryHandlerMetadata","instance","constructor","chain","Object","Function","prototype","own","QUERY_HANDLER_METADATA","get","length","push","getPrototypeOf","reverse","flat"],"mappings":";;AAOA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACG,SAAUA,uBAAuBA,CAACC,QAAgB,EAAA;AAGtD,EAAA,IAAIC,WAAW,GAAYD,QAAQ,CAACC,WAAW;EAE/C,IAAMC,KAAK,GAAuC,EAAE;AAEpD;AACA,EAAA,OAAO,OAAOD,WAAW,KAAK,UAAU,IAAIA,WAAW,KAAKE,MAAM,IAAIF,WAAW,KAAKG,QAAQ,CAACC,SAAS,EAAE;AACxG,IAAA,IAAMC,GAAG,GAAuCC,sBAAsB,CAACC,GAAG,CAACP,WAAqB,CAAC;AAEjG,IAAA,IAAIK,GAAG,IAAIA,GAAG,CAACG,MAAM,GAAG,CAAC,EAAE;AACzBP,MAAAA,KAAK,CAACQ,IAAI,CAACJ,GAAG,CAAC;AACjB,IAAA;AAEAL,IAAAA,WAAW,GAAGE,MAAM,CAACQ,cAAc,CAACV,WAAW,CAAC;AAClD,EAAA;AAQA;EACA,OAAOC,KAAK,CAACU,OAAO,EAAE,CAACC,IAAI,EAAE;AAC/B;;;;"}
1
+ {"version":3,"file":"get-query-handler-metadata.js","sources":["../../../../../../../../src/wirestate-core/queries/get-query-handler-metadata.ts"],"sourcesContent":[null],"names":["getQueryHandlerMetadata","instance","constructor","chain","Object","Function","prototype","own","QUERY_HANDLER_METADATA","get","length","push","getPrototypeOf","reverse","flat"],"mappings":";;AAOA;;;;;;;;;;;;;;;;;;;;;;;AAuBG;AACG,SAAUA,uBAAuBA,CAACC,QAAgB,EAAA;AAGtD,EAAA,IAAIC,WAAW,GAAYD,QAAQ,CAACC,WAAW;EAE/C,MAAMC,KAAK,GAAuC,EAAE;AAEpD;AACA,EAAA,OAAO,OAAOD,WAAW,KAAK,UAAU,IAAIA,WAAW,KAAKE,MAAM,IAAIF,WAAW,KAAKG,QAAQ,CAACC,SAAS,EAAE;AACxG,IAAA,MAAMC,GAAG,GAAuCC,sBAAsB,CAACC,GAAG,CAACP,WAAqB,CAAC;AAEjG,IAAA,IAAIK,GAAG,IAAIA,GAAG,CAACG,MAAM,GAAG,CAAC,EAAE;AACzBP,MAAAA,KAAK,CAACQ,IAAI,CAACJ,GAAG,CAAC;AACjB,IAAA;AAEAL,IAAAA,WAAW,GAAGE,MAAM,CAACQ,cAAc,CAACV,WAAW,CAAC;AAClD,EAAA;AAQA;EACA,OAAOC,KAAK,CAACU,OAAO,EAAE,CAACC,IAAI,EAAE;AAC/B;;;;"}
@@ -29,9 +29,9 @@ import { QUERY_HANDLER_METADATA } from '../registry.js';
29
29
  * ```
30
30
  */
31
31
  function OnQuery(type) {
32
- return function (target, propertyKey) {
33
- var constructor = target.constructor;
34
- var list = QUERY_HANDLER_METADATA.get(constructor);
32
+ return (target, propertyKey) => {
33
+ const constructor = target.constructor;
34
+ let list = QUERY_HANDLER_METADATA.get(constructor);
35
35
  if (!list) {
36
36
  list = [];
37
37
  QUERY_HANDLER_METADATA.set(constructor, list);
@@ -39,7 +39,7 @@ function OnQuery(type) {
39
39
  // Register handler metadata for prototype-based retrieval.
40
40
  list.push({
41
41
  methodName: propertyKey,
42
- type: type
42
+ type
43
43
  });
44
44
  };
45
45
  }
@@ -1 +1 @@
1
- {"version":3,"file":"on-query.js","sources":["../../../../../../../../src/wirestate-core/queries/on-query.ts"],"sourcesContent":[null],"names":["OnQuery","type","target","propertyKey","constructor","list","QUERY_HANDLER_METADATA","get","set","push","methodName"],"mappings":";;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AACG,SAAUA,OAAOA,CAACC,IAAe,EAAA;AACrC,EAAA,OAAO,UAACC,MAAM,EAAEC,WAAW,EAAA;AASzB,IAAA,IAAMC,WAAW,GAAGF,MAAM,CAACE,WAAW;AAEtC,IAAA,IAAIC,IAAI,GAAuCC,sBAAsB,CAACC,GAAG,CAACH,WAAW,CAAC;IAEtF,IAAI,CAACC,IAAI,EAAE;AACTA,MAAAA,IAAI,GAAG,EAAE;AACTC,MAAAA,sBAAsB,CAACE,GAAG,CAACJ,WAAW,EAAEC,IAAI,CAAC;AAC/C,IAAA;AAEA;IACAA,IAAI,CAACI,IAAI,CAAC;AAAEC,MAAAA,UAAU,EAAEP,WAAW;AAAEF,MAAAA,IAAI,EAAAA;AAAA,KAAE,CAAC;EAC9C,CAAC;AACH;;;;"}
1
+ {"version":3,"file":"on-query.js","sources":["../../../../../../../../src/wirestate-core/queries/on-query.ts"],"sourcesContent":[null],"names":["OnQuery","type","target","propertyKey","constructor","list","QUERY_HANDLER_METADATA","get","set","push","methodName"],"mappings":";;AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BG;AACG,SAAUA,OAAOA,CAACC,IAAe,EAAA;AACrC,EAAA,OAAO,CAACC,MAAM,EAAEC,WAAW,KAAI;AAS7B,IAAA,MAAMC,WAAW,GAAGF,MAAM,CAACE,WAAW;AAEtC,IAAA,IAAIC,IAAI,GAAuCC,sBAAsB,CAACC,GAAG,CAACH,WAAW,CAAC;IAEtF,IAAI,CAACC,IAAI,EAAE;AACTA,MAAAA,IAAI,GAAG,EAAE;AACTC,MAAAA,sBAAsB,CAACE,GAAG,CAACJ,WAAW,EAAEC,IAAI,CAAC;AAC/C,IAAA;AAEA;IACAA,IAAI,CAACI,IAAI,CAAC;AAAEC,MAAAA,UAAU,EAAEP,WAAW;AAAEF,MAAAA;AAAI,KAAE,CAAC;EAC9C,CAAC;AACH;;;;"}