Skip to content

Commit 2ff9f3d

Browse files
committed
experimental async
1 parent 2cd3378 commit 2ff9f3d

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

example/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
var split = require('split-require')
12
var css = require('sheetify')
23
var choo = require('../')
34

@@ -15,4 +16,6 @@ app.route('#active', require('./views/main'))
1516
app.route('#completed', require('./views/main'))
1617
app.route('*', require('./views/main'))
1718

19+
app.experimentalAsyncRoute('/async', () => split('./views/main.js'))
20+
1821
module.exports = app.mount('body')

example/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"todomvc-common": "^1.0.3"
1616
},
1717
"devDependencies": {
18-
"bankai": "^9.0.0-rc6",
18+
"bankai": "9.10.4",
19+
"split-require": "^3.1.0",
1920
"standard": "^9.0.1"
2021
}
2122
}

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ Choo.prototype.route = function (route, handler) {
8383
}
8484

8585
// Register a route to be loaded asynchronously.
86-
Choo.prototype.asyncRoute = function (route, load) {
86+
Choo.prototype.experimentalAsyncRoute = function (route, load) {
8787
assert.equal(typeof route, 'string', 'choo.asyncRoute: asyncRoute should be type string')
8888
assert.equal(typeof handler, 'function', 'choo.asyncRoute: route should be type function')
8989

0 commit comments

Comments
 (0)