Add location.url() shorthand

location.url() === location.current().url
This commit is contained in:
Feross Aboukhadijeh
2016-05-19 18:54:44 -07:00
parent 9747d28514
commit 60a8969abc
4 changed files with 13 additions and 8 deletions

View File

@@ -6,6 +6,11 @@ function LocationHistory () {
this._forward = []
this._pending = false
}
LocationHistory.prototype.url = function () {
return this.current() && this.current().url
}
LocationHistory.prototype.current = function () {
return this._history[this._history.length - 1]
}