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.

1 line
8.2 KiB

{"ast":null,"code":"'use strict';\n\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport Platform from \"../../../exports/Platform\";\nimport RCTDeviceEventEmitter from \"./RCTDeviceEventEmitter\";\nimport invariant from 'fbjs/lib/invariant';\nvar NativeEventEmitter = function () {\n function NativeEventEmitter(nativeModule) {\n _classCallCheck(this, NativeEventEmitter);\n if (Platform.OS === 'ios') {\n invariant(nativeModule != null, '`new NativeEventEmitter()` requires a non-null argument.');\n this._nativeModule = nativeModule;\n }\n }\n _createClass(NativeEventEmitter, [{\n key: \"addListener\",\n value: function addListener(eventType, listener, context) {\n var _this = this;\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: function 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 }, {\n key: \"removeListener\",\n value: function 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 }, {\n key: \"emit\",\n value: function 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.apply(RCTDeviceEventEmitter, [eventType].concat(args));\n }\n }, {\n key: \"removeAllListeners\",\n value: function 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 }, {\n key: \"listenerCount\",\n value: function listenerCount(eventType) {\n return RCTDeviceEventEmitter.listenerCount(eventType);\n }\n }]);\n return NativeEventEmitter;\n}();\nexport { NativeEventEmitter as default };","map":{"version":3,"names":["Platform","RCTDeviceEventEmitter","invariant","NativeEventEmitter","nativeModule","OS","_nativeModule","eventType","listener","context","_this$_nativeModule","addListener","subscription","remove","_this$_nativeModule2","removeListeners","_this$_nativeModule3","removeListener","_len","arguments","length","args","Array","_key","emit","_this$_nativeModule4","listenerCount","removeAllListeners"],"sources":["/Users/thomaschazot/Documents/But2A/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/vendor/react-native/NativeEventEmitter/index.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'use strict';\n\nimport Platform from '../../../exports/Platform';\nimport RCTDeviceEventEmitter from './RCTDeviceEventEmitter';\nimport invariant from 'fbjs/lib/invariant';\n\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\n addListener(eventType, listener, context) {\n var _this$_nativeModule;\n\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\n (_this$_nativeModule2 = this._nativeModule) == null ? void 0 : _this$_nativeModule2.removeListeners(1); // $FlowFixMe[incompatible-use]\n\n subscription.remove();\n subscription = null;\n }\n }\n };\n }\n /**\n * @deprecated Use `remove` on the EventSubscription from `addListener`.\n */\n\n\n removeListener(eventType, listener) {\n var _this$_nativeModule3;\n\n (_this$_nativeModule3 = this._nativeModule) == null ? void 0 : _this$_nativeModule3.removeListeners(1); // NOTE: This will report a deprecation notice via `console.error`.\n // $FlowFixMe[prop-missing] - `removeListener` exists but is deprecated.\n\n RCTDeviceEventEmitter.removeListener(eventType, listener);\n }\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\n // Generally, `RCTDeviceEventEmitter` is directly invoked. But this is\n // included for completeness.\n RCTDeviceEventEmitter.emit(eventType, ...args);\n }\n\n removeAllListeners(eventType) {\n var _this$_nativeModule4;\n\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\n listenerCount(eventType) {\n return RCTDeviceEventEmitter.listenerCount(eventType);\n }\n\n}"],"mappings":"AASA,YAAY;;AAAC;AAAA;AAEb,OAAOA,QAAQ;AACf,OAAOC,qBAAqB;AAC5B,OAAOC,SAAS,MAAM,oBAAoB;AAAC,IAYtBC,kBAAkB;EACrC,4BAAYC,YAAY,EAAE;IAAA;IACxB,IAAIJ,QAAQ,CAACK,EAAE,KAAK,KAAK,EAAE;MACzBH,SAAS,CAACE,YAAY,IAAI,IAAI,EAAE,0DAA0D,CAAC;MAC3F,IAAI,CAACE,aAAa,GAAGF,YAAY;IACnC;EACF;EAAC;IAAA;IAAA,OAED,qBAAYG,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