@apia/util 4.0.13 → 4.0.15

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/index.d.ts CHANGED
@@ -46,14 +46,11 @@ declare global {
46
46
  }
47
47
  declare const getDateFormat: () => TDateFormat;
48
48
 
49
- declare global {
50
- const WP_DEVELOP_MODE: boolean;
51
- }
52
49
  /**
53
50
  * Indica si el debugDispatcher fue activado, lo que en muchos casos indica que
54
51
  * estamos en ambiente de desarrollo
55
52
  */
56
- declare function isDebugDispatcherEnabled(): boolean;
53
+ declare function isDebugDispatcherEnabled(): any;
57
54
  type TWindowDDispatch = (action: string, ...parameters: unknown[]) => void;
58
55
  type TDispatchCallback = (parameters: unknown[]) => unknown;
59
56
  interface IStoredCallback {
package/dist/index.js CHANGED
@@ -186,7 +186,7 @@ function dateToApiaFormat(date) {
186
186
  return dayjs(date).format(getDateFormat());
187
187
  }
188
188
 
189
- const isEnabled = WP_DEVELOP_MODE;
189
+ const isEnabled = window?.WP_DEVELOP_MODE;
190
190
  function isDebugDispatcherEnabled() {
191
191
  return isEnabled;
192
192
  }
@@ -1118,12 +1118,12 @@ class StatefulEmitter extends EventEmitter {
1118
1118
  }
1119
1119
  on(event, cb) {
1120
1120
  if (this.state[event])
1121
- this.emit(event, this.state[event]);
1121
+ cb(this.state[event]);
1122
1122
  return super.on(event, cb);
1123
1123
  }
1124
1124
  once(event, cb) {
1125
1125
  if (this.state[event]) {
1126
- this.emit(event, this.state[event]);
1126
+ cb(this.state[event]);
1127
1127
  return () => {
1128
1128
  };
1129
1129
  }