@tamagui/react-native-web-lite
Version:
React Native for Web
49 lines (48 loc) • 2.17 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: !0 });
}, __copyProps = (to, from, except, desc) => {
if (from && typeof from == "object" || typeof from == "function")
for (let key of __getOwnPropNames(from))
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
var EmitterSubscription_exports = {};
__export(EmitterSubscription_exports, {
EmitterSubscription: () => EmitterSubscription,
default: () => EmitterSubscription_default
});
module.exports = __toCommonJS(EmitterSubscription_exports);
var import_EventSubscription = require("./_EventSubscription");
class EmitterSubscription extends import_EventSubscription._EventSubscription {
/**
* @param {EventEmitter} emitter - The event emitter that registered this
* subscription
* @param {EventSubscriptionVendor} subscriber - The subscriber that controls
* this subscription
* @param {function} listener - Function to invoke when the specified event is
* emitted
* @param {*} context - Optional context object to use when invoking the
* listener
*/
constructor(emitter, subscriber, listener, context) {
super(subscriber), this.emitter = emitter, this.listener = listener, this.context = context;
}
/**
* Removes this subscription from the emitter that registered it.
* Note: we're overriding the `remove()` method of _EventSubscription here
* but deliberately not calling `super.remove()` as the responsibility
* for removing the subscription lies with the EventEmitter.
*/
remove() {
this.emitter.removeSubscription(this);
}
}
var EmitterSubscription_default = EmitterSubscription;
//# sourceMappingURL=_EmitterSubscription.js.map