react-router
Version:
A complete routing library for React.js
58 lines (33 loc) • 942 B
Markdown
API: `Location` (object)
==========================
You can supply the router with your own location implementation. The
following methods must be implemented:
Methods
-------
Called when the router is first setup.
Called when the router is torn down.
Called when the router is transitioning from one path to another.
Called when ther router is replacing (not transitioning) one url with
another.
### `pop`
Called when the router attempts to go back one entry in the history.
### `toString`
Should return a useful string for logging and debugging.
Example
-------
This is a terrible example, you're probably better off looking at the
implementations in this repository.
```js
var MyLocation = {
setup: function () {},
teardown: function () {},
push: function (path) {},
replace: function (path) {},
pop: function () {},
toString: function () {}
};
```