feat(router): Support unsubscription from Location by returning the subscription.
This commit is contained in:
parent
8dd3082ea3
commit
2674eaca51
|
@ -44,8 +44,8 @@ export class SpyLocation implements Location {
|
||||||
}
|
}
|
||||||
|
|
||||||
subscribe(onNext: (value: any) => void, onThrow: (error: any) => void = null,
|
subscribe(onNext: (value: any) => void, onThrow: (error: any) => void = null,
|
||||||
onReturn: () => void = null) {
|
onReturn: () => void = null): Object {
|
||||||
ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
|
return ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: remove these once Location is an interface, and can be implemented cleanly
|
// TODO: remove these once Location is an interface, and can be implemented cleanly
|
||||||
|
|
|
@ -144,8 +144,8 @@ export class Location {
|
||||||
* Subscribe to the platform's `popState` events.
|
* Subscribe to the platform's `popState` events.
|
||||||
*/
|
*/
|
||||||
subscribe(onNext: (value: any) => void, onThrow: (exception: any) => void = null,
|
subscribe(onNext: (value: any) => void, onThrow: (exception: any) => void = null,
|
||||||
onReturn: () => void = null): void {
|
onReturn: () => void = null): Object {
|
||||||
ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
|
return ObservableWrapper.subscribe(this._subject, onNext, onThrow, onReturn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue