sample-piral 1.3.1 → 1.3.2-beta.6156

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/app/index.d.ts CHANGED
@@ -21,6 +21,12 @@ export interface EventEmitter {
21
21
  * @param callback The callback to trigger.
22
22
  */
23
23
  on<K extends keyof PiralEventMap>(type: K, callback: Listener<PiralEventMap[K]>): EventEmitter;
24
+ /**
25
+ * Attaches a new event listener that is removed once the event fired.
26
+ * @param type The type of the event to listen for.
27
+ * @param callback The callback to trigger.
28
+ */
29
+ once<K extends keyof PiralEventMap>(type: K, callback: Listener<PiralEventMap[K]>): EventEmitter;
24
30
  /**
25
31
  * Detaches an existing event listener.
26
32
  * @param type The type of the event to listen for.
@@ -6436,11 +6436,11 @@ function installPiralDebug(options) {
6436
6436
  debug: debugApiVersion,
6437
6437
  instance: {
6438
6438
  name: "sample-piral",
6439
- version: "1.3.1",
6439
+ version: "1.3.2-beta.6156",
6440
6440
  dependencies: "reactstrap,tslib,react,react-dom,react-router,react-router-dom"
6441
6441
  },
6442
6442
  build: {
6443
- date: "2023-10-19T19:23:49.214Z",
6443
+ date: "2023-10-20T14:55:58.004Z",
6444
6444
  cli: "1.3.1",
6445
6445
  compat: "1"
6446
6446
  }
@@ -65475,6 +65475,7 @@ function runPilet(createApi, pilet) {
65475
65475
  function initializeApi(target, events) {
65476
65476
  return {
65477
65477
  on: events.on,
65478
+ once: events.once,
65478
65479
  off: events.off,
65479
65480
  emit: events.emit,
65480
65481
  meta: (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__assign)({}, target)
@@ -65926,6 +65927,14 @@ function createListener() {
65926
65927
  eventListeners.push([callback, listener]);
65927
65928
  return this;
65928
65929
  },
65930
+ once: function once(type, callback) {
65931
+ var _this = this;
65932
+ var cb = function cb(ev) {
65933
+ _this.off(type, cb);
65934
+ callback(ev);
65935
+ };
65936
+ return this.on(type, cb);
65937
+ },
65929
65938
  off: function off(type, callback) {
65930
65939
  var _eventListeners$filte = eventListeners.filter(function (m) {
65931
65940
  return m[0] === callback;
@@ -65939,12 +65948,14 @@ function createListener() {
65939
65948
  return this;
65940
65949
  },
65941
65950
  emit: function emit(type, arg) {
65942
- var ce = document.createEvent("CustomEvent");
65943
- ce.initCustomEvent(nameOf(type), false, false, {
65944
- arg: arg,
65945
- state: state
65946
- });
65947
- document.body.dispatchEvent(ce);
65951
+ document.body.dispatchEvent(new CustomEvent(nameOf(type), {
65952
+ bubbles: false,
65953
+ cancelable: false,
65954
+ detail: {
65955
+ arg: arg,
65956
+ state: state
65957
+ }
65958
+ }));
65948
65959
  return this;
65949
65960
  }
65950
65961
  };
@@ -66269,4 +66280,4 @@ root.render( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_1__.createElement(piral
66269
66280
 
66270
66281
  /******/ })()
66271
66282
  ;
66272
- //# sourceMappingURL=index.534573.js.map
66283
+ //# sourceMappingURL=index.de43b2.js.map