Using luge with a JS framework
Luge is browser-only. Create one instance after the client DOM is available; core services are singletons even though the public entry point is a class.
Initialization
// Run in your framework's client mount hook, once for the application.
const { Luge, Reveal } = await import('@waaark/luge')
const luge = new Luge()
luge.addPlugin('reveal', Reveal)
luge.init()
Route changes
When the framework owns routing, omit the Transition plugin. After the new DOM is committed, call luge.lifecycle.refresh() to run pageKill → pageInit → pageLoad → pageIn → reveal.
For additions within the current page, call luge.emitter.emit('update') instead. Register custom callbacks once, and remove your own event/ticker subscriptions when their owner is disposed.
There is no complete public destroy() API or independent multi-instance isolation. Avoid constructing a new instance on every component mount. Test persistent elements and repeated refreshes in your integration; see known limitations.