How to use postscribe - 1 common examples

To help you get started, we’ve selected a few postscribe examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jeshan / cloudformation-checklist / src / scripts / components / Dropdown.js View on Github external
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';
          },
        });
    }

  }

postscribe

Asynchronously write javascript, even with document.write.

MIT
Latest version published 8 years ago

Package Health Score

59 / 100
Full package analysis

Popular postscribe functions