{"ast":null,"code":"'use strict';\n\nimport invariant from 'fbjs/lib/invariant';\n\nvar EventSubscriptionVendor = function () {\n  function EventSubscriptionVendor() {\n    this._subscriptionsForType = {};\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 == null) {\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/rohitsingh/Documents/projects/new-nativebase-setup/NativeBase/example/node_modules/react-native-web/dist/vendor/react-native/emitter/_EventSubscriptionVendor.js"],"names":["invariant","EventSubscriptionVendor","_subscriptionsForType","_proto","prototype","addSubscription","eventType","subscription","subscriber","key","length","push","removeAllSubscriptions","removeSubscription","subscriptionsForType","getSubscriptionsForType"],"mappings":"AASA;;AAEA,OAAOA,SAAP,MAAsB,oBAAtB;;AAMA,IAAIC,uBAAuB,GAAgB,YAAY;AACrD,WAASA,uBAAT,GAAmC;AACjC,SAAKC,qBAAL,GAA6B,EAA7B;AACD;;AASD,MAAIC,MAAM,GAAGF,uBAAuB,CAACG,SAArC;;AAEA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P;AACD,GAFD;;AAIA,SAAOL,uBAAP;AACD,CAhF0C,EAA3C;;AAkFA,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 = /*#__PURE__*/function () {\n  function EventSubscriptionVendor() {\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  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 == 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  _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"}