File tree Expand file tree Collapse file tree 1 file changed +10
-22
lines changed Expand file tree Collapse file tree 1 file changed +10
-22
lines changed Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ following methods must be implemented:
7
7
Methods
8
8
-------
9
9
10
- ### ` setup() `
10
+ ### ` setup(onChange ) `
11
11
12
- Called when the router is first setup.
12
+ Called when the router is first setup. The ` onChange ` function should be
13
+ called without any arguments when the location changes.
13
14
14
15
### ` teardown `
15
16
@@ -28,30 +29,17 @@ another.
28
29
29
30
Called when the router attempts to go back one entry in the history.
30
31
32
+ ### ` getCurrentPath `
33
+
34
+ Should return the current URL path, complete with query string (if applicable).
35
+ This method should be ready to go immediately after setup.
36
+
31
37
### ` toString `
32
38
33
39
Should return a useful string for logging and debugging.
34
40
35
41
Example
36
42
-------
37
43
38
- This is a terrible example, you're probably better off looking at the
39
- implementations in this repository.
40
-
41
- ``` js
42
- var MyLocation = {
43
-
44
- setup : function () {},
45
-
46
- teardown : function () {},
47
-
48
- push : function (path ) {},
49
-
50
- replace : function (path ) {},
51
-
52
- pop : function () {},
53
-
54
- toString : function () {}
55
-
56
- };
57
- ```
44
+ For examples of how to implement your own location, please see the locations
45
+ included in this repository.
You can’t perform that action at this time.
0 commit comments