From 64e381531de34e86750ba64dbc3b13d4449f6ff3 Mon Sep 17 00:00:00 2001 From: Paul Taylor Date: Thu, 8 Dec 2016 02:29:26 -0800 Subject: [PATCH] fix(SubscribeOnObservable): Add the source subscription to the action disposable so the source will This fix makes SubscribeOnObservable keep track of the source subscription. Before, the source subscription wouldn't be disposed. --- src/observable/SubscribeOnObservable.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/observable/SubscribeOnObservable.ts b/src/observable/SubscribeOnObservable.ts index cf003c4c70..19f3539521 100644 --- a/src/observable/SubscribeOnObservable.ts +++ b/src/observable/SubscribeOnObservable.ts @@ -1,3 +1,4 @@ +import { Action } from '../scheduler/Action'; import { Scheduler } from '../Scheduler'; import { Subscriber } from '../Subscriber'; import { Subscription } from '../Subscription'; @@ -20,9 +21,9 @@ export class SubscribeOnObservable extends Observable { return new SubscribeOnObservable(source, delay, scheduler); } - static dispatch(arg: DispatchArg): Subscription { + static dispatch(this: Action, arg: DispatchArg): Subscription { const { source, subscriber } = arg; - return source.subscribe(subscriber); + return this.add(source.subscribe(subscriber)); } constructor(public source: Observable,