{"ast":null,"code":"'use strict';\n\nimport invariant from 'fbjs/lib/invariant';\n\nvar EventSubscriptionVendor = function () {\n  function EventSubscriptionVendor() {\n    this._subscriptionsForType = {};\n    this._currentSubscription = null;\n  }\n\n  var _proto = EventSubscriptionVendor.prototype;\n\n  _proto.addSubscription = function 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  _proto.removeAllSubscriptions = function removeAllSubscriptions(eventType) {\n    if (eventType === undefined) {\n      this._subscriptionsForType = {};\n    } else {\n      delete this._subscriptionsForType[eventType];\n    }\n  };\n\n  _proto.removeSubscription = function 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  _proto.getSubscriptionsForType = function getSubscriptionsForType(eventType) {\n    return this._subscriptionsForType[eventType];\n  };\n\n  return EventSubscriptionVendor;\n}();\n\nexport default EventSubscriptionVendor;","map":{"version":3,"sources":["/Users/nishan/Desktop/oss/responsive-breakpoints/example/node_modules/react-native-web/dist/vendor/react-native/emitter/EventSubscriptionVendor.js"],"names":["invariant","EventSubscriptionVendor","_subscriptionsForType","_currentSubscription","_proto","prototype","addSubscription","eventType","subscription","subscriber","key","length","push","removeAllSubscriptions","undefined","removeSubscription","subscriptionsForType","getSubscriptionsForType"],"mappings":"AASA;;AAEA,OAAOA,SAAP,MAAsB,oBAAtB;;AAMA,IAAIC,uBAAuB,GAE3B,YAAY;AACV,WAASA,uBAAT,GAAmC;AACjC,SAAKC,qBAAL,GAA6B,EAA7B;AACA,SAAKC,oBAAL,GAA4B,IAA5B;AAC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AA4C;AAC3E,WAAO,KAAKL,qBAAL,CAA2BK,SAA3B,CAAP;AACD,GAFD;;AAIA,SAAON,uBAAP;AACD,CAjFD,EAFA;;AAqFA,eAAeA,uBAAf","sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its 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 */\nvar EventSubscriptionVendor =\n/*#__PURE__*/\nfunction () {\n  function EventSubscriptionVendor() {\n    this._subscriptionsForType = {};\n    this._currentSubscription = null;\n  }\n  /**\n   * Adds a subscription keyed by an event type.\n   *\n   * @param {string} eventType\n   * @param {EventSubscription} subscription\n   */\n\n\n  var _proto = EventSubscriptionVendor.prototype;\n\n  _proto.addSubscription = function 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  _proto.removeAllSubscriptions = function removeAllSubscriptions(eventType) {\n    if (eventType === undefined) {\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  _proto.removeSubscription = function 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  _proto.getSubscriptionsForType = function getSubscriptionsForType(eventType) {\n    return this._subscriptionsForType[eventType];\n  };\n\n  return EventSubscriptionVendor;\n}();\n\nexport default EventSubscriptionVendor;"]},"metadata":{},"sourceType":"module"}