feat(router): Support unsubscription from Location by returning the subscription.

This commit is contained in:
Alex Rickabaugh 2015-10-26 11:00:24 -07:00
parent 8dd3082ea3
commit 2674eaca51
2 changed files with 4 additions and 4 deletions

View File

@ -44,8 +44,8 @@ export class SpyLocation implements Location {
}
subscribe(onNext: (value: any) => void, onThrow: (error: any) => void = null,
onReturn: () => void = null) {
ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
onReturn: () => void = null): Object {
return ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
}
// TODO: remove these once Location is an interface, and can be implemented cleanly

View File

@ -144,8 +144,8 @@ export class Location {
* Subscribe to the platform's `popState` events.
*/
subscribe(onNext: (value: any) => void, onThrow: (exception: any) => void = null,
onReturn: () => void = null): void {
ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
onReturn: () => void = null): Object {
return ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
}
}