UNPKG

repoweaver

Version:

A GitHub App that skillfully weaves multiple templates together to create and update repositories with intelligent merge strategies

1 lines 7.68 kB
{"ast":null,"code":"'use strict';\n\nimport Platform from \"../../../exports/Platform\";\nimport RCTDeviceEventEmitter from \"./RCTDeviceEventEmitter\";\nimport invariant from 'fbjs/lib/invariant';\nexport default class NativeEventEmitter {\n constructor(nativeModule) {\n if (Platform.OS === 'ios') {\n invariant(nativeModule != null, '`new NativeEventEmitter()` requires a non-null argument.');\n this._nativeModule = nativeModule;\n }\n }\n addListener(eventType, listener, context) {\n var _this$_nativeModule;\n (_this$_nativeModule = this._nativeModule) == null ? void 0 : _this$_nativeModule.addListener(eventType);\n var subscription = RCTDeviceEventEmitter.addListener(eventType, listener, context);\n return {\n remove: () => {\n if (subscription != null) {\n var _this$_nativeModule2;\n (_this$_nativeModule2 = this._nativeModule) == null ? void 0 : _this$_nativeModule2.removeListeners(1);\n subscription.remove();\n subscription = null;\n }\n }\n };\n }\n removeListener(eventType, listener) {\n var _this$_nativeModule3;\n (_this$_nativeModule3 = this._nativeModule) == null ? void 0 : _this$_nativeModule3.removeListeners(1);\n RCTDeviceEventEmitter.removeListener(eventType, listener);\n }\n emit(eventType) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n RCTDeviceEventEmitter.emit(eventType, ...args);\n }\n removeAllListeners(eventType) {\n var _this$_nativeModule4;\n invariant(eventType != null, '`NativeEventEmitter.removeAllListener()` requires a non-null argument.');\n (_this$_nativeModule4 = this._nativeModule) == null ? void 0 : _this$_nativeModule4.removeListeners(this.listenerCount(eventType));\n RCTDeviceEventEmitter.removeAllListeners(eventType);\n }\n listenerCount(eventType) {\n return RCTDeviceEventEmitter.listenerCount(eventType);\n }\n}","map":{"version":3,"names":["Platform","RCTDeviceEventEmitter","invariant","NativeEventEmitter","constructor","nativeModule","OS","_nativeModule","addListener","eventType","listener","context","_this$_nativeModule","subscription","remove","_this$_nativeModule2","removeListeners","removeListener","_this$_nativeModule3","emit","_len","arguments","length","args","Array","_key","removeAllListeners","_this$_nativeModule4","listenerCount"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-web/dist/vendor/react-native/EventEmitter/NativeEventEmitter.js"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n\n'use strict';\n\nimport Platform from '../../../exports/Platform';\nimport RCTDeviceEventEmitter from './RCTDeviceEventEmitter';\nimport invariant from 'fbjs/lib/invariant';\n/**\n * `NativeEventEmitter` is intended for use by Native Modules to emit events to\n * JavaScript listeners. If a `NativeModule` is supplied to the constructor, it\n * will be notified (via `addListener` and `removeListeners`) when the listener\n * count changes to manage \"native memory\".\n *\n * Currently, all native events are fired via a global `RCTDeviceEventEmitter`.\n * This means event names must be globally unique, and it means that call sites\n * can theoretically listen to `RCTDeviceEventEmitter` (although discouraged).\n */\nexport default class NativeEventEmitter {\n constructor(nativeModule) {\n if (Platform.OS === 'ios') {\n invariant(nativeModule != null, '`new NativeEventEmitter()` requires a non-null argument.');\n this._nativeModule = nativeModule;\n }\n }\n addListener(eventType, listener, context) {\n var _this$_nativeModule;\n (_this$_nativeModule = this._nativeModule) == null ? void 0 : _this$_nativeModule.addListener(eventType);\n var subscription = RCTDeviceEventEmitter.addListener(eventType, listener, context);\n return {\n remove: () => {\n if (subscription != null) {\n var _this$_nativeModule2;\n (_this$_nativeModule2 = this._nativeModule) == null ? void 0 : _this$_nativeModule2.removeListeners(1);\n // $FlowFixMe[incompatible-use]\n subscription.remove();\n subscription = null;\n }\n }\n };\n }\n\n /**\n * @deprecated Use `remove` on the EventSubscription from `addListener`.\n */\n removeListener(eventType, listener) {\n var _this$_nativeModule3;\n (_this$_nativeModule3 = this._nativeModule) == null ? void 0 : _this$_nativeModule3.removeListeners(1);\n // NOTE: This will report a deprecation notice via `console.error`.\n // $FlowFixMe[prop-missing] - `removeListener` exists but is deprecated.\n RCTDeviceEventEmitter.removeListener(eventType, listener);\n }\n emit(eventType) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n // Generally, `RCTDeviceEventEmitter` is directly invoked. But this is\n // included for completeness.\n RCTDeviceEventEmitter.emit(eventType, ...args);\n }\n removeAllListeners(eventType) {\n var _this$_nativeModule4;\n invariant(eventType != null, '`NativeEventEmitter.removeAllListener()` requires a non-null argument.');\n (_this$_nativeModule4 = this._nativeModule) == null ? void 0 : _this$_nativeModule4.removeListeners(this.listenerCount(eventType));\n RCTDeviceEventEmitter.removeAllListeners(eventType);\n }\n listenerCount(eventType) {\n return RCTDeviceEventEmitter.listenerCount(eventType);\n }\n}"],"mappings":"AAUA,YAAY;;AAEZ,OAAOA,QAAQ;AACf,OAAOC,qBAAqB;AAC5B,OAAOC,SAAS,MAAM,oBAAoB;AAW1C,eAAe,MAAMC,kBAAkB,CAAC;EACtCC,WAAWA,CAACC,YAAY,EAAE;IACxB,IAAIL,QAAQ,CAACM,EAAE,KAAK,KAAK,EAAE;MACzBJ,SAAS,CAACG,YAAY,IAAI,IAAI,EAAE,0DAA0D,CAAC;MAC3F,IAAI,CAACE,aAAa,GAAGF,YAAY;IACnC;EACF;EACAG,WAAWA,CAACC,SAAS,EAAEC,QAAQ,EAAEC,OAAO,EAAE;IACxC,IAAIC,mBAAmB;IACvB,CAACA,mBAAmB,GAAG,IAAI,CAACL,aAAa,KAAK,IAAI,GAAG,KAAK,CAAC,GAAGK,mBAAmB,CAACJ,WAAW,CAACC,SAAS,CAAC;IACxG,IAAII,YAAY,GAAGZ,qBAAqB,CAACO,WAAW,CAACC,SAAS,EAAEC,QAAQ,EAAEC,OAAO,CAAC;IAClF,OAAO;MACLG,MAAM,EAAEA,CAAA,KAAM;QACZ,IAAID,YAAY,IAAI,IAAI,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