Skip to content

Instantly share code, notes, and snippets.

@thawkin3
Created March 4, 2020 23:22
Show Gist options
  • Save thawkin3/90a9b6890b9c09b55fd425e94e7f6ff3 to your computer and use it in GitHub Desktop.
Save thawkin3/90a9b6890b9c09b55fd425e94e7f6ff3 to your computer and use it in GitHub Desktop.
Using an import to initially load some JS
import { exportPdf } from './pdf-download.js'
const exportPdfButton = document.querySelector('.exportPdfButton')
exportPdfButton.addEventListener('click', exportPdf)
// this code is short, but the 'pdf-download.js' module is loaded on page load rather than when the button is clicked
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment