MCPcopy
hub / github.com/coder/mux / delete

Method delete

src/browser/stores/MapStore.ts:136–155  ·  view source on GitHub ↗

* Delete a key (clears version and all cached values).

(key: K)

Source from the content-addressed store, hash-verified

134 * Delete a key (clears version and all cached values).
135 */
136 delete(key: K): void {
137 if (!this.versions.has(key)) return;
138
139 // Clear all cached values for this key
140 const keyStr = String(key);
141 for (const cacheKey of Array.from(this.cache.keys())) {
142 if (cacheKey.startsWith(`${keyStr}:`)) {
143 this.cache.delete(cacheKey);
144 }
145 }
146
147 this.versions.delete(key);
148
149 // Notify
150 for (const l of this.global) l();
151 const ks = this.perKey.get(key);
152 if (ks) {
153 for (const l of ks) l();
154 }
155 }
156
157 /**
158 * Clear all data.

Callers 15

service-worker.jsFile · 0.45
ProjectSidebarInnerFunction · 0.45
handleCheckboxClickFunction · 0.45
handleSelectAllFunction · 0.45
handleUnarchiveFunction · 0.45
handleBulkDeleteWorktreeFunction · 0.45
handleDeleteWorktreeFunction · 0.45
handleDeleteFunction · 0.45
ProjectPageFunction · 0.45
toggleRemoteFunction · 0.45
toggleBashOutputGroupFunction · 0.45
subscribeKeyFunction · 0.45

Calls 2

getMethod · 0.65
hasMethod · 0.45

Tested by 14

subscribeKeyFunction · 0.36
createMockLocalStorageFunction · 0.36
removeItemFunction · 0.36
cancelAnimationFrameMockFunction · 0.36
iterateFunction · 0.36
removeEventListenerMethod · 0.36
removeItemMethod · 0.36
cancelAnimationFrameMockFunction · 0.36
removeItemMethod · 0.36