+4
-0
@@ -0,1 +1,5 @@ | ||
| 0.3.3 / 2013-12-09 | ||
| =================== | ||
| * Adding `init` method to keep initial state clean | ||
| 0.3.2 / 2013-12-09 | ||
@@ -2,0 +6,0 @@ =================== |
+6
-2
@@ -38,2 +38,6 @@ var way = require('./way'), | ||
| exports.init = function() { | ||
| dispatch(this.pathname()); | ||
| }; | ||
| exports.mode = function (m){ | ||
@@ -43,3 +47,3 @@ routes = []; | ||
| flo = flow(routes, mode); | ||
| } | ||
| }; | ||
@@ -75,2 +79,2 @@ exports.use = function(mid){ | ||
| middleware = null | ||
| } | ||
| }; |
+1
-1
| { | ||
| "name": "ways", | ||
| "version": "0.3.2", | ||
| "version": "0.3.3", | ||
| "author": "Anderson Arboleya <anderson@arboleya.me>", | ||
@@ -5,0 +5,0 @@ "description": "Micro router with flow-based navigation mechanism and addapters support", |
+7
-1
@@ -30,2 +30,3 @@ # Ways | ||
| ways('/my/route', function(req){ /* ... */ }); | ||
| ways.init(); | ||
| ```` | ||
@@ -56,2 +57,5 @@ | ||
| ways('*', handler); | ||
| // initialize | ||
| ways.init(); | ||
| ```` | ||
@@ -181,3 +185,5 @@ | ||
| ````javascript | ||
| ways.go('/pages/33/edit'); | ||
| // pretend current url is '/pages/33/edit' | ||
| // init method will use it | ||
| ways.init(); | ||
| ```` | ||
@@ -184,0 +190,0 @@ |
17128
1.49%259
1.17%285
2.15%