Skip to content

Commit

Permalink
fix(index): revert return types
Browse files Browse the repository at this point in the history
The return types were updating to be more accurage, indicating the possible Promise return values. However, the return types in the history base class were not. As a result, the TS definitions will not build and this would render TS devs unable to use the module. I've reverted this for now. Later, we can first update history and the history-browser so that there's proper compatability. This would still be a breaking change for TS users but at least the code would compile.
  • Loading branch information
EisenbergEffect committed Jun 13, 2018
1 parent d1a816d commit 0481af4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,9 @@ export class BrowserHistory extends History {
*
* @param fragment The history fragment to navigate to.
* @param options The set of options that specify how the navigation should occur.
* @return Promise if triggering navigation, otherwise true/false indicating if navigation occured.
* @return Promise if triggering navigation, otherwise true/false indicating if navigation occurred.
*/
navigate(fragment?: string, {trigger = true, replace = false} = {}): Promise|boolean {
navigate(fragment?: string, {trigger = true, replace = false} = {}): boolean {
if (fragment && absoluteUrl.test(fragment)) {
this.location.href = fragment;
return true;
Expand Down Expand Up @@ -234,7 +234,7 @@ export class BrowserHistory extends History {
}
}

_loadUrl(fragmentOverride: string): Promise|boolean {
_loadUrl(fragmentOverride: string): boolean {
let fragment = this.fragment = this._getFragment(fragmentOverride);

return this.options.routeHandler ?
Expand Down

0 comments on commit 0481af4

Please sign in to comment.