Skip to content

Commit

Permalink
refactor(TestScheduler): return hot and cold observables instead of g…
Browse files Browse the repository at this point in the history
…eneric observable

Return HotObservable and ColdObservable instead of simply Observable, in order to give users access to subscriptions parameter
  • Loading branch information
mpodlasin committed Jan 20, 2017
1 parent 31cf2bf commit 79f2f9e
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/testing/TestScheduler.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Observable } from '../Observable';
import { Notification } from '../Notification';
import { Subject } from '../Subject';
import { ColdObservable } from './ColdObservable';
import { HotObservable } from './HotObservable';
import { TestMessage } from './TestMessage';
Expand Down Expand Up @@ -36,7 +35,7 @@ export class TestScheduler extends VirtualTimeScheduler {
return indexOf * TestScheduler.frameTimeFactor;
}

createColdObservable<T>(marbles: string, values?: any, error?: any): Observable<T> {
createColdObservable<T>(marbles: string, values?: any, error?: any): ColdObservable<T> {
if (marbles.indexOf('^') !== -1) {
throw new Error('cold observable cannot have subscription offset "^"');
}
Expand All @@ -49,7 +48,7 @@ export class TestScheduler extends VirtualTimeScheduler {
return cold;
}

createHotObservable<T>(marbles: string, values?: any, error?: any): Subject<T> {
createHotObservable<T>(marbles: string, values?: any, error?: any): HotObservable<T> {
if (marbles.indexOf('!') !== -1) {
throw new Error('hot observable cannot have unsubscription marker "!"');
}
Expand Down

0 comments on commit 79f2f9e

Please sign in to comment.