Skip to content

Commit 723545a

Browse files
committed
Update Location docs
1 parent d57f830 commit 723545a

File tree

1 file changed

+10
-22
lines changed

1 file changed

+10
-22
lines changed

docs/api/misc/Location.md

Lines changed: 10 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ following methods must be implemented:
77
Methods
88
-------
99

10-
### `setup()`
10+
### `setup(onChange)`
1111

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.
1314

1415
### `teardown`
1516

@@ -28,30 +29,17 @@ another.
2829

2930
Called when the router attempts to go back one entry in the history.
3031

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+
3137
### `toString`
3238

3339
Should return a useful string for logging and debugging.
3440

3541
Example
3642
-------
3743

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.

0 commit comments

Comments
 (0)