ipfs storage for images and other nontext items. for use with etica - runs on etica network and currencys
https://collect.etica-stats.org
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.3 KiB
46 lines
1.3 KiB
"use strict"; |
|
Object.defineProperty(exports, "__esModule", { value: true }); |
|
exports.EventPayload = void 0; |
|
/** |
|
* Events allow for applications to use the observer pattern, which |
|
* allows subscribing and publishing events, outside the normal |
|
* execution paths. |
|
* |
|
* @_section api/utils/events:Events [about-events] |
|
*/ |
|
const properties_js_1 = require("./properties.js"); |
|
/** |
|
* When an [[EventEmitterable]] triggers a [[Listener]], the |
|
* callback always ahas one additional argument passed, which is |
|
* an **EventPayload**. |
|
*/ |
|
class EventPayload { |
|
/** |
|
* The event filter. |
|
*/ |
|
filter; |
|
/** |
|
* The **EventEmitterable**. |
|
*/ |
|
emitter; |
|
#listener; |
|
/** |
|
* Create a new **EventPayload** for %%emitter%% with |
|
* the %%listener%% and for %%filter%%. |
|
*/ |
|
constructor(emitter, listener, filter) { |
|
this.#listener = listener; |
|
(0, properties_js_1.defineProperties)(this, { emitter, filter }); |
|
} |
|
/** |
|
* Unregister the triggered listener for future events. |
|
*/ |
|
async removeListener() { |
|
if (this.#listener == null) { |
|
return; |
|
} |
|
await this.emitter.off(this.filter, this.#listener); |
|
} |
|
} |
|
exports.EventPayload = EventPayload; |
|
//# sourceMappingURL=events.js.map
|