MCPcopy Index your code
hub / github.com/plotly/dash / clear

Method clear

dash/dash-renderer/src/persistence.js:148–161  ·  view source on GitHub ↗
(keyPrefix)

Source from the content-addressed store, hash-verified

146 * characters) - or all keys associated with this store if no prefix.
147 */
148 clear(keyPrefix) {
149 const fullPrefix = storePrefix + (keyPrefix || '');
150 const keyMatch = keyPrefixMatch(fullPrefix, keyPrefix ? '.' : '');
151 const keysToRemove = [];
152 // 2-step process, so we don't depend on any particular behavior of
153 // key order while removing some
154 for (let i = 0; i < this._storage.length; i++) {
155 const fullKey = this._storage.key(i);
156 if (keyMatch(fullKey)) {
157 keysToRemove.push(fullKey);
158 }
159 }
160 forEach(k => this._storage.removeItem(k), keysToRemove);
161 }
162}
163
164class MemStore {

Callers 2

tryGetWebStoreFunction · 0.95
clearStoresFunction · 0.45

Calls 4

keyPrefixMatchFunction · 0.85
keyMethod · 0.80
pushMethod · 0.80
removeItemMethod · 0.45

Tested by 1

clearStoresFunction · 0.36