Closed acoutts closed 6 years ago
document.addEventListener('scatterLoaded', scatterExtension => {
const scatter = window.scatter;
window.scatter = null;
callYourCallback(scatter);
});
I do that but won't that CB only execute if the scatterLoaded event fires?
What I'm looking for is a way to detect when that doesn't work, perhaps the timeout I'm using is the best option but I wanted to see what else was available.
Yup, only a timeout. Scatter can't tell you that it doesn't exist.
I can always check the window.scatter reference after a timeout, but is there a more reliable way to check if Scatter is installed?