Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function destroyAll() : ZalgoPromise {
if (bridge) {
bridge.destroyBridges();
}
const results = [];
const global = getGlobal();
global.activeComponents = global.activeComponents || [];
while (global.activeComponents.length) {
results.push(global.activeComponents[0].destroy(new Error(`zoid destroyed all`), false));
}
return ZalgoPromise.all(results).then(noop);
}