🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

excalibur-router

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

excalibur-router - npm Package Compare versions

Comparing version

to
0.0.2

2

package.json
{
"name": "excalibur-router",
"version": "0.0.1",
"version": "0.0.2",
"description": "",

@@ -5,0 +5,0 @@ "type": "module",

@@ -86,2 +86,27 @@ # excalibur-router

## Dynamic Scene Loading
Scenes can be imported dynamically as routes, which will then trigger a loading scene when navigated to. If these scenes contain any `router.addResource()` calls or import files that do, they will get loaded in the same loading screen.
```js
import * as ex from 'excalibur'
import { Router } from 'excalibur-router'
const engine = new ex.Engine({
width: 800,
height: 600,
})
const router = new Router({
routes: {
level1: () => import('./level1'), // contains default export of scene
level2: () => import('./level2'),
},
})
router.start(engine).then(() => {
router.goto('level1')
})
```
## Transitions

@@ -88,0 +113,0 @@