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
5.8 KiB
1 line
5.8 KiB
{"ast":null,"code":"'use strict';\n\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport invariant from 'fbjs/lib/invariant';\nvar EventSubscriptionVendor = function () {\n function EventSubscriptionVendor() {\n _classCallCheck(this, EventSubscriptionVendor);\n this._subscriptionsForType = {};\n }\n _createClass(EventSubscriptionVendor, [{\n key: \"addSubscription\",\n value: function addSubscription(eventType, subscription) {\n invariant(subscription.subscriber === this, 'The subscriber of the subscription is incorrectly set.');\n if (!this._subscriptionsForType[eventType]) {\n this._subscriptionsForType[eventType] = [];\n }\n var key = this._subscriptionsForType[eventType].length;\n this._subscriptionsForType[eventType].push(subscription);\n subscription.eventType = eventType;\n subscription.key = key;\n return subscription;\n }\n }, {\n key: \"removeAllSubscriptions\",\n value: function removeAllSubscriptions(eventType) {\n if (eventType == null) {\n this._subscriptionsForType = {};\n } else {\n delete this._subscriptionsForType[eventType];\n }\n }\n }, {\n key: \"removeSubscription\",\n value: function removeSubscription(subscription) {\n var eventType = subscription.eventType;\n var key = subscription.key;\n var subscriptionsForType = this._subscriptionsForType[eventType];\n if (subscriptionsForType) {\n delete subscriptionsForType[key];\n }\n }\n }, {\n key: \"getSubscriptionsForType\",\n value: function getSubscriptionsForType(eventType) {\n return this._subscriptionsForType[eventType];\n }\n }]);\n return EventSubscriptionVendor;\n}();\nexport default EventSubscriptionVendor;","map":{"version":3,"names":["invariant","EventSubscriptionVendor","_subscriptionsForType","eventType","subscription","subscriber","key","length","push","subscriptionsForType"],"sources":["/Users/thomaschazot/Documents/But2A/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/vendor/react-native/emitter/_EventSubscriptionVendor.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 * @format\n * \n */\n'use strict';\n\nimport invariant from 'fbjs/lib/invariant';\n\n/**\n * EventSubscriptionVendor stores a set of EventSubscriptions that are\n * subscribed to a particular event type.\n */\nclass EventSubscriptionVendor {\n constructor() {\n this._subscriptionsForType = {};\n }\n /**\n * Adds a subscription keyed by an event type.\n *\n * @param {string} eventType\n * @param {EventSubscription} subscription\n */\n\n\n addSubscription(eventType, subscription) {\n invariant(subscription.subscriber === this, 'The subscriber of the subscription is incorrectly set.');\n\n if (!this._subscriptionsForType[eventType]) {\n this._subscriptionsForType[eventType] = [];\n }\n\n var key = this._subscriptionsForType[eventType].length;\n\n this._subscriptionsForType[eventType].push(subscription);\n\n subscription.eventType = eventType;\n subscription.key = key;\n return subscription;\n }\n /**\n * Removes a bulk set of the subscriptions.\n *\n * @param {?string} eventType - Optional name of the event type whose\n * registered supscriptions to remove, if null remove all subscriptions.\n */\n\n\n removeAllSubscriptions(eventType) {\n if (eventType == null) {\n this._subscriptionsForType = {};\n } else {\n delete this._subscriptionsForType[eventType];\n }\n }\n /**\n * Removes a specific subscription. Instead of calling this function, call\n * `subscription.remove()` directly.\n *\n * @param {object} subscription\n */\n\n\n removeSubscription(subscription) {\n var eventType = subscription.eventType;\n var key = subscription.key;\n var subscriptionsForType = this._subscriptionsForType[eventType];\n\n if (subscriptionsForType) {\n delete subscriptionsForType[key];\n }\n }\n /**\n * Returns the array of subscriptions that are currently registered for the\n * given event type.\n *\n * Note: This array can be potentially sparse as subscriptions are deleted\n * from it when they are removed.\n *\n * TODO: This returns a nullable array. wat?\n *\n * @param {string} eventType\n * @returns {?array}\n */\n\n\n getSubscriptionsForType(eventType) {\n return this._subscriptionsForType[eventType];\n }\n\n}\n\nexport default EventSubscriptionVendor;"],"mappings":"AASA,YAAY;;AAAC;AAAA;AAEb,OAAOA,SAAS,MAAM,oBAAoB;AAAC,IAMrCC,uBAAuB;EAC3B,mCAAc;IAAA;IACZ,IAAI,CAACC,qBAAqB,GAAG,CAAC,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