Skip to content

Instantly share code, notes, and snippets.

@iliakan
Created October 29, 2019 10:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iliakan/e99834f1829ebb5ea1eb44024704eda4 to your computer and use it in GitHub Desktop.
Save iliakan/e99834f1829ebb5ea1eb44024704eda4 to your computer and use it in GitHub Desktop.
export default async function(pageModule, route) {
const {default: Page} = await import(`../src/pages/${pageModule}`);
const page = new Page(route);
const renderedPage = await page.render();
const contentNode = document.querySelector('#content');
contentNode.innerHTML = '';
contentNode.appendChild(renderedPage);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment