houdini-svelte 1.2.35 → 1.2.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -77028,11 +77028,10 @@ var InMemorySubscriptions = class {
77028
77028
  constructor(cache) {
77029
77029
  this.cache = cache;
77030
77030
  }
77031
- subscribers = {};
77032
- referenceCounts = {};
77031
+ subscribers = /* @__PURE__ */ new Map();
77033
77032
  keyVersions = {};
77034
77033
  activeFields(parent2) {
77035
- return Object.keys(this.subscribers[parent2] || {});
77034
+ return Object.keys(this.subscribers.get(parent2) || {});
77036
77035
  }
77037
77036
  add({
77038
77037
  parent: parent2,
@@ -77106,27 +77105,28 @@ var InMemorySubscriptions = class {
77106
77105
  type
77107
77106
  }) {
77108
77107
  const spec = selection[0];
77109
- if (!this.subscribers[id2]) {
77110
- this.subscribers[id2] = {};
77108
+ if (!this.subscribers.has(id2)) {
77109
+ this.subscribers.set(id2, /* @__PURE__ */ new Map());
77111
77110
  }
77112
- if (!this.subscribers[id2][key]) {
77113
- this.subscribers[id2][key] = [];
77111
+ const subscriber = this.subscribers.get(id2);
77112
+ if (!subscriber.has(key)) {
77113
+ subscriber.set(key, {
77114
+ selections: [],
77115
+ referenceCounts: /* @__PURE__ */ new Map()
77116
+ });
77114
77117
  }
77118
+ const subscriberField = subscriber.get(key);
77115
77119
  if (!this.keyVersions[key]) {
77116
77120
  this.keyVersions[key] = /* @__PURE__ */ new Set();
77117
77121
  }
77118
77122
  this.keyVersions[key].add(key);
77119
- if (!this.subscribers[id2][key].map(([{ set }]) => set).includes(spec.set)) {
77120
- this.subscribers[id2][key].push([spec, selection[1]]);
77121
- }
77122
- if (!this.referenceCounts[id2]) {
77123
- this.referenceCounts[id2] = {};
77124
- }
77125
- if (!this.referenceCounts[id2][key]) {
77126
- this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
77123
+ if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
77124
+ subscriberField.selections.push([spec, selection[1]]);
77127
77125
  }
77128
- const counts = this.referenceCounts[id2][key];
77129
- counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
77126
+ subscriberField.referenceCounts.set(
77127
+ spec.set,
77128
+ (subscriberField.referenceCounts.get(spec.set) || 0) + 1
77129
+ );
77130
77130
  this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
77131
77131
  }
77132
77132
  registerList({
@@ -77213,7 +77213,7 @@ var InMemorySubscriptions = class {
77213
77213
  }
77214
77214
  }
77215
77215
  get(id2, field) {
77216
- return this.subscribers[id2]?.[field] || [];
77216
+ return this.subscribers.get(id2)?.get(field)?.selections || [];
77217
77217
  }
77218
77218
  remove(id2, selection, targets, variables, visited = []) {
77219
77219
  visited.push(id2);
@@ -77239,24 +77239,24 @@ var InMemorySubscriptions = class {
77239
77239
  }
77240
77240
  }
77241
77241
  reset() {
77242
- const subscribers = Object.entries(this.subscribers).filter(
77243
- ([id2]) => !id2.startsWith(rootID)
77244
- );
77242
+ const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID));
77245
77243
  for (const [id2, _fields] of subscribers) {
77246
- delete this.subscribers[id2];
77244
+ this.subscribers.delete(id2);
77247
77245
  }
77248
77246
  const subscriptionSpecs = subscribers.flatMap(
77249
- ([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
77247
+ ([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
77250
77248
  );
77251
77249
  return subscriptionSpecs;
77252
77250
  }
77253
77251
  removeSubscribers(id2, fieldName, specs) {
77254
77252
  let targets = [];
77253
+ const subscriber = this.subscribers.get(id2);
77254
+ const subscriberField = subscriber?.get(fieldName);
77255
77255
  for (const spec of specs) {
77256
- if (!this.referenceCounts[id2]?.[fieldName]?.has(spec.set)) {
77256
+ const counts = subscriber?.get(fieldName)?.referenceCounts;
77257
+ if (!counts?.has(spec.set)) {
77257
77258
  continue;
77258
77259
  }
77259
- const counts = this.referenceCounts[id2][fieldName];
77260
77260
  const newVal = (counts.get(spec.set) || 0) - 1;
77261
77261
  counts.set(spec.set, newVal);
77262
77262
  if (newVal <= 0) {
@@ -77264,18 +77264,19 @@ var InMemorySubscriptions = class {
77264
77264
  counts.delete(spec.set);
77265
77265
  }
77266
77266
  }
77267
- if (this.subscribers[id2]) {
77268
- this.subscribers[id2][fieldName] = this.get(id2, fieldName).filter(
77267
+ if (subscriberField) {
77268
+ subscriberField.selections = this.get(id2, fieldName).filter(
77269
77269
  ([{ set }]) => !targets.includes(set)
77270
77270
  );
77271
77271
  }
77272
77272
  }
77273
77273
  removeAllSubscribers(id2, targets, visited = []) {
77274
77274
  visited.push(id2);
77275
- for (const field of Object.keys(this.subscribers[id2] || [])) {
77276
- const subscribers = targets || this.subscribers[id2][field].map(([spec]) => spec);
77277
- this.removeSubscribers(id2, field, subscribers);
77278
- const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, field);
77275
+ const subscriber = this.subscribers.get(id2);
77276
+ for (const [key, val] of subscriber?.entries() ?? []) {
77277
+ const subscribers = targets || val.selections.map(([spec]) => spec);
77278
+ this.removeSubscribers(id2, key, subscribers);
77279
+ const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
77279
77280
  if (kind === "scalar") {
77280
77281
  continue;
77281
77282
  }
@@ -134457,11 +134458,10 @@ var InMemorySubscriptions2 = class {
134457
134458
  constructor(cache) {
134458
134459
  this.cache = cache;
134459
134460
  }
134460
- subscribers = {};
134461
- referenceCounts = {};
134461
+ subscribers = /* @__PURE__ */ new Map();
134462
134462
  keyVersions = {};
134463
134463
  activeFields(parent2) {
134464
- return Object.keys(this.subscribers[parent2] || {});
134464
+ return Object.keys(this.subscribers.get(parent2) || {});
134465
134465
  }
134466
134466
  add({
134467
134467
  parent: parent2,
@@ -134535,27 +134535,28 @@ var InMemorySubscriptions2 = class {
134535
134535
  type
134536
134536
  }) {
134537
134537
  const spec = selection[0];
134538
- if (!this.subscribers[id2]) {
134539
- this.subscribers[id2] = {};
134538
+ if (!this.subscribers.has(id2)) {
134539
+ this.subscribers.set(id2, /* @__PURE__ */ new Map());
134540
134540
  }
134541
- if (!this.subscribers[id2][key]) {
134542
- this.subscribers[id2][key] = [];
134541
+ const subscriber = this.subscribers.get(id2);
134542
+ if (!subscriber.has(key)) {
134543
+ subscriber.set(key, {
134544
+ selections: [],
134545
+ referenceCounts: /* @__PURE__ */ new Map()
134546
+ });
134543
134547
  }
134548
+ const subscriberField = subscriber.get(key);
134544
134549
  if (!this.keyVersions[key]) {
134545
134550
  this.keyVersions[key] = /* @__PURE__ */ new Set();
134546
134551
  }
134547
134552
  this.keyVersions[key].add(key);
134548
- if (!this.subscribers[id2][key].map(([{ set }]) => set).includes(spec.set)) {
134549
- this.subscribers[id2][key].push([spec, selection[1]]);
134550
- }
134551
- if (!this.referenceCounts[id2]) {
134552
- this.referenceCounts[id2] = {};
134553
- }
134554
- if (!this.referenceCounts[id2][key]) {
134555
- this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
134553
+ if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
134554
+ subscriberField.selections.push([spec, selection[1]]);
134556
134555
  }
134557
- const counts = this.referenceCounts[id2][key];
134558
- counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
134556
+ subscriberField.referenceCounts.set(
134557
+ spec.set,
134558
+ (subscriberField.referenceCounts.get(spec.set) || 0) + 1
134559
+ );
134559
134560
  this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
134560
134561
  }
134561
134562
  registerList({
@@ -134642,7 +134643,7 @@ var InMemorySubscriptions2 = class {
134642
134643
  }
134643
134644
  }
134644
134645
  get(id2, field) {
134645
- return this.subscribers[id2]?.[field] || [];
134646
+ return this.subscribers.get(id2)?.get(field)?.selections || [];
134646
134647
  }
134647
134648
  remove(id2, selection, targets, variables, visited = []) {
134648
134649
  visited.push(id2);
@@ -134668,24 +134669,24 @@ var InMemorySubscriptions2 = class {
134668
134669
  }
134669
134670
  }
134670
134671
  reset() {
134671
- const subscribers = Object.entries(this.subscribers).filter(
134672
- ([id2]) => !id2.startsWith(rootID2)
134673
- );
134672
+ const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID2));
134674
134673
  for (const [id2, _fields] of subscribers) {
134675
- delete this.subscribers[id2];
134674
+ this.subscribers.delete(id2);
134676
134675
  }
134677
134676
  const subscriptionSpecs = subscribers.flatMap(
134678
- ([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
134677
+ ([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
134679
134678
  );
134680
134679
  return subscriptionSpecs;
134681
134680
  }
134682
134681
  removeSubscribers(id2, fieldName, specs) {
134683
134682
  let targets = [];
134683
+ const subscriber = this.subscribers.get(id2);
134684
+ const subscriberField = subscriber?.get(fieldName);
134684
134685
  for (const spec of specs) {
134685
- if (!this.referenceCounts[id2]?.[fieldName]?.has(spec.set)) {
134686
+ const counts = subscriber?.get(fieldName)?.referenceCounts;
134687
+ if (!counts?.has(spec.set)) {
134686
134688
  continue;
134687
134689
  }
134688
- const counts = this.referenceCounts[id2][fieldName];
134689
134690
  const newVal = (counts.get(spec.set) || 0) - 1;
134690
134691
  counts.set(spec.set, newVal);
134691
134692
  if (newVal <= 0) {
@@ -134693,18 +134694,19 @@ var InMemorySubscriptions2 = class {
134693
134694
  counts.delete(spec.set);
134694
134695
  }
134695
134696
  }
134696
- if (this.subscribers[id2]) {
134697
- this.subscribers[id2][fieldName] = this.get(id2, fieldName).filter(
134697
+ if (subscriberField) {
134698
+ subscriberField.selections = this.get(id2, fieldName).filter(
134698
134699
  ([{ set }]) => !targets.includes(set)
134699
134700
  );
134700
134701
  }
134701
134702
  }
134702
134703
  removeAllSubscribers(id2, targets, visited = []) {
134703
134704
  visited.push(id2);
134704
- for (const field of Object.keys(this.subscribers[id2] || [])) {
134705
- const subscribers = targets || this.subscribers[id2][field].map(([spec]) => spec);
134706
- this.removeSubscribers(id2, field, subscribers);
134707
- const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, field);
134705
+ const subscriber = this.subscribers.get(id2);
134706
+ for (const [key, val] of subscriber?.entries() ?? []) {
134707
+ const subscribers = targets || val.selections.map(([spec]) => spec);
134708
+ this.removeSubscribers(id2, key, subscribers);
134709
+ const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
134708
134710
  if (kind === "scalar") {
134709
134711
  continue;
134710
134712
  }
@@ -199190,11 +199192,10 @@ var InMemorySubscriptions3 = class {
199190
199192
  constructor(cache) {
199191
199193
  this.cache = cache;
199192
199194
  }
199193
- subscribers = {};
199194
- referenceCounts = {};
199195
+ subscribers = /* @__PURE__ */ new Map();
199195
199196
  keyVersions = {};
199196
199197
  activeFields(parent2) {
199197
- return Object.keys(this.subscribers[parent2] || {});
199198
+ return Object.keys(this.subscribers.get(parent2) || {});
199198
199199
  }
199199
199200
  add({
199200
199201
  parent: parent2,
@@ -199268,27 +199269,28 @@ var InMemorySubscriptions3 = class {
199268
199269
  type
199269
199270
  }) {
199270
199271
  const spec = selection[0];
199271
- if (!this.subscribers[id2]) {
199272
- this.subscribers[id2] = {};
199272
+ if (!this.subscribers.has(id2)) {
199273
+ this.subscribers.set(id2, /* @__PURE__ */ new Map());
199273
199274
  }
199274
- if (!this.subscribers[id2][key]) {
199275
- this.subscribers[id2][key] = [];
199275
+ const subscriber = this.subscribers.get(id2);
199276
+ if (!subscriber.has(key)) {
199277
+ subscriber.set(key, {
199278
+ selections: [],
199279
+ referenceCounts: /* @__PURE__ */ new Map()
199280
+ });
199276
199281
  }
199282
+ const subscriberField = subscriber.get(key);
199277
199283
  if (!this.keyVersions[key]) {
199278
199284
  this.keyVersions[key] = /* @__PURE__ */ new Set();
199279
199285
  }
199280
199286
  this.keyVersions[key].add(key);
199281
- if (!this.subscribers[id2][key].map(([{ set }]) => set).includes(spec.set)) {
199282
- this.subscribers[id2][key].push([spec, selection[1]]);
199283
- }
199284
- if (!this.referenceCounts[id2]) {
199285
- this.referenceCounts[id2] = {};
199286
- }
199287
- if (!this.referenceCounts[id2][key]) {
199288
- this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
199287
+ if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
199288
+ subscriberField.selections.push([spec, selection[1]]);
199289
199289
  }
199290
- const counts = this.referenceCounts[id2][key];
199291
- counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
199290
+ subscriberField.referenceCounts.set(
199291
+ spec.set,
199292
+ (subscriberField.referenceCounts.get(spec.set) || 0) + 1
199293
+ );
199292
199294
  this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
199293
199295
  }
199294
199296
  registerList({
@@ -199375,7 +199377,7 @@ var InMemorySubscriptions3 = class {
199375
199377
  }
199376
199378
  }
199377
199379
  get(id2, field) {
199378
- return this.subscribers[id2]?.[field] || [];
199380
+ return this.subscribers.get(id2)?.get(field)?.selections || [];
199379
199381
  }
199380
199382
  remove(id2, selection, targets, variables, visited = []) {
199381
199383
  visited.push(id2);
@@ -199401,24 +199403,24 @@ var InMemorySubscriptions3 = class {
199401
199403
  }
199402
199404
  }
199403
199405
  reset() {
199404
- const subscribers = Object.entries(this.subscribers).filter(
199405
- ([id2]) => !id2.startsWith(rootID3)
199406
- );
199406
+ const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID3));
199407
199407
  for (const [id2, _fields] of subscribers) {
199408
- delete this.subscribers[id2];
199408
+ this.subscribers.delete(id2);
199409
199409
  }
199410
199410
  const subscriptionSpecs = subscribers.flatMap(
199411
- ([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
199411
+ ([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
199412
199412
  );
199413
199413
  return subscriptionSpecs;
199414
199414
  }
199415
199415
  removeSubscribers(id2, fieldName, specs) {
199416
199416
  let targets = [];
199417
+ const subscriber = this.subscribers.get(id2);
199418
+ const subscriberField = subscriber?.get(fieldName);
199417
199419
  for (const spec of specs) {
199418
- if (!this.referenceCounts[id2]?.[fieldName]?.has(spec.set)) {
199420
+ const counts = subscriber?.get(fieldName)?.referenceCounts;
199421
+ if (!counts?.has(spec.set)) {
199419
199422
  continue;
199420
199423
  }
199421
- const counts = this.referenceCounts[id2][fieldName];
199422
199424
  const newVal = (counts.get(spec.set) || 0) - 1;
199423
199425
  counts.set(spec.set, newVal);
199424
199426
  if (newVal <= 0) {
@@ -199426,18 +199428,19 @@ var InMemorySubscriptions3 = class {
199426
199428
  counts.delete(spec.set);
199427
199429
  }
199428
199430
  }
199429
- if (this.subscribers[id2]) {
199430
- this.subscribers[id2][fieldName] = this.get(id2, fieldName).filter(
199431
+ if (subscriberField) {
199432
+ subscriberField.selections = this.get(id2, fieldName).filter(
199431
199433
  ([{ set }]) => !targets.includes(set)
199432
199434
  );
199433
199435
  }
199434
199436
  }
199435
199437
  removeAllSubscribers(id2, targets, visited = []) {
199436
199438
  visited.push(id2);
199437
- for (const field of Object.keys(this.subscribers[id2] || [])) {
199438
- const subscribers = targets || this.subscribers[id2][field].map(([spec]) => spec);
199439
- this.removeSubscribers(id2, field, subscribers);
199440
- const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, field);
199439
+ const subscriber = this.subscribers.get(id2);
199440
+ for (const [key, val] of subscriber?.entries() ?? []) {
199441
+ const subscribers = targets || val.selections.map(([spec]) => spec);
199442
+ this.removeSubscribers(id2, key, subscribers);
199443
+ const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
199441
199444
  if (kind === "scalar") {
199442
199445
  continue;
199443
199446
  }
@@ -265480,11 +265483,10 @@ var InMemorySubscriptions4 = class {
265480
265483
  constructor(cache) {
265481
265484
  this.cache = cache;
265482
265485
  }
265483
- subscribers = {};
265484
- referenceCounts = {};
265486
+ subscribers = /* @__PURE__ */ new Map();
265485
265487
  keyVersions = {};
265486
265488
  activeFields(parent2) {
265487
- return Object.keys(this.subscribers[parent2] || {});
265489
+ return Object.keys(this.subscribers.get(parent2) || {});
265488
265490
  }
265489
265491
  add({
265490
265492
  parent: parent2,
@@ -265558,27 +265560,28 @@ var InMemorySubscriptions4 = class {
265558
265560
  type
265559
265561
  }) {
265560
265562
  const spec = selection[0];
265561
- if (!this.subscribers[id2]) {
265562
- this.subscribers[id2] = {};
265563
+ if (!this.subscribers.has(id2)) {
265564
+ this.subscribers.set(id2, /* @__PURE__ */ new Map());
265563
265565
  }
265564
- if (!this.subscribers[id2][key]) {
265565
- this.subscribers[id2][key] = [];
265566
+ const subscriber = this.subscribers.get(id2);
265567
+ if (!subscriber.has(key)) {
265568
+ subscriber.set(key, {
265569
+ selections: [],
265570
+ referenceCounts: /* @__PURE__ */ new Map()
265571
+ });
265566
265572
  }
265573
+ const subscriberField = subscriber.get(key);
265567
265574
  if (!this.keyVersions[key]) {
265568
265575
  this.keyVersions[key] = /* @__PURE__ */ new Set();
265569
265576
  }
265570
265577
  this.keyVersions[key].add(key);
265571
- if (!this.subscribers[id2][key].map(([{ set }]) => set).includes(spec.set)) {
265572
- this.subscribers[id2][key].push([spec, selection[1]]);
265573
- }
265574
- if (!this.referenceCounts[id2]) {
265575
- this.referenceCounts[id2] = {};
265576
- }
265577
- if (!this.referenceCounts[id2][key]) {
265578
- this.referenceCounts[id2][key] = /* @__PURE__ */ new Map();
265578
+ if (!subscriberField.selections.some(([{ set }]) => set === spec.set)) {
265579
+ subscriberField.selections.push([spec, selection[1]]);
265579
265580
  }
265580
- const counts = this.referenceCounts[id2][key];
265581
- counts.set(spec.set, (counts.get(spec.set) || 0) + 1);
265581
+ subscriberField.referenceCounts.set(
265582
+ spec.set,
265583
+ (subscriberField.referenceCounts.get(spec.set) || 0) + 1
265584
+ );
265582
265585
  this.cache._internal_unstable.lifetimes.resetLifetime(id2, key);
265583
265586
  }
265584
265587
  registerList({
@@ -265665,7 +265668,7 @@ var InMemorySubscriptions4 = class {
265665
265668
  }
265666
265669
  }
265667
265670
  get(id2, field) {
265668
- return this.subscribers[id2]?.[field] || [];
265671
+ return this.subscribers.get(id2)?.get(field)?.selections || [];
265669
265672
  }
265670
265673
  remove(id2, selection, targets, variables, visited = []) {
265671
265674
  visited.push(id2);
@@ -265691,24 +265694,24 @@ var InMemorySubscriptions4 = class {
265691
265694
  }
265692
265695
  }
265693
265696
  reset() {
265694
- const subscribers = Object.entries(this.subscribers).filter(
265695
- ([id2]) => !id2.startsWith(rootID4)
265696
- );
265697
+ const subscribers = [...this.subscribers.entries()].filter(([id2]) => !id2.startsWith(rootID4));
265697
265698
  for (const [id2, _fields] of subscribers) {
265698
- delete this.subscribers[id2];
265699
+ this.subscribers.delete(id2);
265699
265700
  }
265700
265701
  const subscriptionSpecs = subscribers.flatMap(
265701
- ([_id, fields]) => Object.values(fields).flatMap((field) => field.map(([spec]) => spec))
265702
+ ([_id, fields]) => [...fields.values()].flatMap((field) => field.selections.map(([spec]) => spec))
265702
265703
  );
265703
265704
  return subscriptionSpecs;
265704
265705
  }
265705
265706
  removeSubscribers(id2, fieldName, specs) {
265706
265707
  let targets = [];
265708
+ const subscriber = this.subscribers.get(id2);
265709
+ const subscriberField = subscriber?.get(fieldName);
265707
265710
  for (const spec of specs) {
265708
- if (!this.referenceCounts[id2]?.[fieldName]?.has(spec.set)) {
265711
+ const counts = subscriber?.get(fieldName)?.referenceCounts;
265712
+ if (!counts?.has(spec.set)) {
265709
265713
  continue;
265710
265714
  }
265711
- const counts = this.referenceCounts[id2][fieldName];
265712
265715
  const newVal = (counts.get(spec.set) || 0) - 1;
265713
265716
  counts.set(spec.set, newVal);
265714
265717
  if (newVal <= 0) {
@@ -265716,18 +265719,19 @@ var InMemorySubscriptions4 = class {
265716
265719
  counts.delete(spec.set);
265717
265720
  }
265718
265721
  }
265719
- if (this.subscribers[id2]) {
265720
- this.subscribers[id2][fieldName] = this.get(id2, fieldName).filter(
265722
+ if (subscriberField) {
265723
+ subscriberField.selections = this.get(id2, fieldName).filter(
265721
265724
  ([{ set }]) => !targets.includes(set)
265722
265725
  );
265723
265726
  }
265724
265727
  }
265725
265728
  removeAllSubscribers(id2, targets, visited = []) {
265726
265729
  visited.push(id2);
265727
- for (const field of Object.keys(this.subscribers[id2] || [])) {
265728
- const subscribers = targets || this.subscribers[id2][field].map(([spec]) => spec);
265729
- this.removeSubscribers(id2, field, subscribers);
265730
- const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, field);
265730
+ const subscriber = this.subscribers.get(id2);
265731
+ for (const [key, val] of subscriber?.entries() ?? []) {
265732
+ const subscribers = targets || val.selections.map(([spec]) => spec);
265733
+ this.removeSubscribers(id2, key, subscribers);
265734
+ const { value: value2, kind } = this.cache._internal_unstable.storage.get(id2, key);
265731
265735
  if (kind === "scalar") {
265732
265736
  continue;
265733
265737
  }