UNPKG

@tamagui/react-native-web-lite

Version:
64 lines (63 loc) 2.71 kB
"use strict"; var __create = Object.create; var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __getProtoOf = Object.getPrototypeOf, __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 __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( // If the importer is in node compatibility mode or this is not an ESM // file that has been converted to a CommonJS file using a Babel- // compatible transform (i.e. "__esModule" has not been set), then set // "default" to the CommonJS "module.exports" for node compatibility. isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: !0 }) : target, mod)), __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod); var EmitterSubscription_exports = {}; __export(EmitterSubscription_exports, { default: () => EmitterSubscription_default }); module.exports = __toCommonJS(EmitterSubscription_exports); var import_EventSubscription = __toESM(require("./_EventSubscription.cjs")); class EmitterSubscription extends import_EventSubscription.default { /** * @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;