Skip to content

Commit 1d8065e

Browse files
committedAug 18, 2017
feat(index): export rxSandbox
1 parent 7bb1877 commit 1d8065e

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed
 

‎src/index.ts

+22-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,22 @@
1-
export {};
1+
import { Observable } from 'rxjs/Observable';
2+
import { TestMessage } from './message/TestMessage';
3+
import { TestScheduler } from './scheduler/TestScheduler';
4+
5+
//workaround TS4029 by explicitly import types and avoid unused import error
6+
(() => Observable.toString())();
7+
8+
const rxSandbox = {
9+
create: (autoFlush: boolean = false, frameTimeFactor: number = 1) => {
10+
const scheduler = new TestScheduler(autoFlush, frameTimeFactor);
11+
12+
return {
13+
hot: scheduler.createHotObservable.bind(scheduler) as typeof scheduler.createHotObservable,
14+
cold: scheduler.createColdObservable.bind(scheduler) as typeof scheduler.createColdObservable,
15+
flush: scheduler.flush.bind(scheduler) as typeof scheduler.flush,
16+
advanceBy: scheduler.advanceBy.bind(scheduler) as typeof scheduler.advanceBy,
17+
advanceTo: scheduler.advanceTo.bind(scheduler) as typeof scheduler.advanceTo
18+
};
19+
}
20+
};
21+
22+
export { rxSandbox, TestMessage };

0 commit comments

Comments
 (0)