Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
loadCode(el) {
const codeContainer = el.querySelector('.js-code');
if (codeContainer !== null) {
const scriptUrl = codeContainer.getAttribute('data-code-url');
let script = document.createElement('script');
script.src = scriptUrl;
postscribe(codeContainer, script.outerHTML, {
// eslint-disable-next-line func-names
done: () => {
const loader = el.querySelector('.js-loader');
loader.style.display = 'none';
},
});
}
}