MCPcopy
hub / github.com/stemdeckapp/stemdeck / storeSetDebounced

Function storeSetDebounced

static/js/utils.js:34–41  ·  view source on GitHub ↗
(key, value, delayMs = 300)

Source from the content-addressed store, hash-verified

32// value so no mutation races occur.
33const _storePending = new Map();
34export function storeSetDebounced(key, value, delayMs = 300) {
35 if (_storePending.has(key)) clearTimeout(_storePending.get(key));
36 const snapshot = structuredClone(value);
37 _storePending.set(key, setTimeout(() => {
38 _storePending.delete(key);
39 storeSet(key, snapshot);
40 }, delayMs));
41}
42
43// Keys that hold critical user data and must be migrated from localStorage
44// to the store on first launch after this feature ships.

Callers 1

saveMixFunction · 0.90

Calls 1

storeSetFunction · 0.85

Tested by

no test coverage detected