MCPcopy Create free account
hub / github.com/instantdb/instant / clearSubscriptionData

Method clearSubscriptionData

client/packages/core/src/SyncTable.ts:855–877  ·  view source on GitHub ↗
(
    subscriptionId: string,
    keepSubscription: boolean,
  )

Source from the content-addressed store, hash-verified

853 }
854
855 private clearSubscriptionData(
856 subscriptionId: string,
857 keepSubscription: boolean,
858 ) {
859 const hash = this.idToHash[subscriptionId];
860 if (hash) {
861 delete this.idToHash[subscriptionId];
862 const sub = this.subs.currentValue[hash];
863 if (sub.state) {
864 this.sendRemove(sub.state, keepSubscription);
865 }
866 if (keepSubscription) {
867 this.subs.unloadKey(hash);
868 } else {
869 this.subs.updateInPlace((prev) => {
870 delete prev[hash];
871 });
872 }
873 if (sub) {
874 return sub;
875 }
876 }
877 }
878
879 public onStartSyncError(msg: {
880 op: 'error';

Callers 2

unsubscribeMethod · 0.95
onResyncErrorMethod · 0.95

Calls 3

sendRemoveMethod · 0.95
unloadKeyMethod · 0.80
updateInPlaceMethod · 0.80

Tested by

no test coverage detected