I have an issue. One of my JS scripts needs Facebook SDK and Twitter widgets JS to load first. Facebook creates FB object, Twitter creates twttr ob
FB
twttr
const checkIfLoaded = ('lib', cb) => { const interval = setInterval(() => { if (lib) { typeof cb === 'function' && cb(); clearInterval(interval); } else { console.log('not yet'); } }, 100); }