Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(history) add go method #43

Merged
merged 1 commit into from
Oct 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ export class BrowserHistory extends History {
}

/**
* Returns the current index in the history object.
* Returns the current index in the navigation history.
* @returns The current index.
*/
getHistoryIndex(): number {
Expand All @@ -218,6 +218,14 @@ export class BrowserHistory extends History {
return historyIndex;
}

/**
* Move to a specific position in the navigation history.
* @param movement The amount of steps, positive or negative, to move.
*/
go(movement: number): void {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We would need an abstract method for the base class History in aurelia-history. It would be an error TS folks without it. This is where the implementation is only.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Am on it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already ❤️ your PRs 👍

this.history.go(movement);
}

_getHash(): string {
return this.location.hash.substr(1);
}
Expand Down