Slide 36
Slide 36 text
import UniversalRouter from 'universal-router'
const router = new UniversalRouter([
{
path: 'books/orders/:id',
async action ({ params }) =>
await import('./pages/books/orders).then(page => page.setup(params.id))
}
])
document.addEventListener('DOMContentLoaded', async () =>
const handler = await router.resolve(location.pathname)
handler()
11