Viewerframe Mode Refresh Hot Apr 2026

async function activateMode(instanceId, mode) { const initId = Symbol(); currentInitId = initId;

let currentInitId = null;

function setModeAsync(mode) { const v = ++modeVersion; return doAsyncSetup(mode).then(result => { if (v !== modeVersion) return; // ignore stale applyMode(result); }); } Debounce/coalesce: viewerframe mode refresh hot

// finalize finalizeModeActivation(instanceId, mode); } Subscription cleanup: async function activateMode(instanceId