import { addUniqueItem as e, removeItem as p } from "./array.es.js";
var f = function() {
  function t() {
    this.subscriptions = [];
  }
  return t.prototype.add = function(i) {
    var s = this;
    return e(this.subscriptions, i), function() {
      return p(s.subscriptions, i);
    };
  }, t.prototype.notify = function(i, s, o) {
    var n = this.subscriptions.length;
    if (!!n)
      if (n === 1)
        this.subscriptions[0](i, s, o);
      else
        for (var r = 0; r < n; r++) {
          var u = this.subscriptions[r];
          u && u(i, s, o);
        }
  }, t.prototype.getSize = function() {
    return this.subscriptions.length;
  }, t.prototype.clear = function() {
    this.subscriptions.length = 0;
  }, t;
}();
export {
  f as SubscriptionManager
};
//# sourceMappingURL=subscription-manager.es.js.map
