router fixes
This commit is contained in:
parent
3fb160c12e
commit
846d6ce24b
2 changed files with 3 additions and 2 deletions
|
|
@ -1,6 +1,7 @@
|
|||
"use strict"
|
||||
|
||||
var Vnode = require("../render/vnode")
|
||||
var Promise = require("../promise/promise")
|
||||
var coreRouter = require("../router/router")
|
||||
|
||||
module.exports = function($window, redrawService) {
|
||||
|
|
|
|||
|
|
@ -384,9 +384,9 @@ For the sake of simplicity, in the example above, the user's logged in status is
|
|||
|
||||
### Code splitting
|
||||
|
||||
In a large application, it may be desirable to download the code for each route on demand, rather than upfront. Dividing the codebase this way is known as code splitting or lazy loading. In Mithril, this can be accomplished by calling the `resolve` callback of the `onmatch` hook asynchronously:
|
||||
In a large application, it may be desirable to download the code for each route on demand, rather than upfront. Dividing the codebase this way is known as code splitting or lazy loading. In Mithril, this can be accomplished by returning a promise from the `onmatch` hook:
|
||||
|
||||
At its simplest form, one could do the following:
|
||||
At its most basic form, one could do the following:
|
||||
|
||||
```javascript
|
||||
// Home.js
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue