diff --git a/src/CoreOperators.ts b/src/CoreOperators.ts index f5cdcf8dac..3739237a13 100644 --- a/src/CoreOperators.ts +++ b/src/CoreOperators.ts @@ -1,10 +1,11 @@ -import {Observable} from './Observable'; import {Scheduler} from './Scheduler'; -import {ConnectableObservable} from './observable/ConnectableObservable'; -import {Subject} from './Subject'; -import {GroupedObservable} from './operator/groupBy-support'; import {Notification} from './Notification'; +import {Observable} from './ambient/Observable'; +import {Subject} from './ambient/Subject'; +import {GroupedObservable} from './ambient/GroupedObservable'; +import {ConnectableObservable} from './ambient/ConnectableObservable'; + export interface CoreOperators { buffer?: (closingNotifier: Observable) => Observable; bufferCount?: (bufferSize: number, startBufferEvery: number) => Observable; diff --git a/src/Observable.ts b/src/Observable.ts index 2e0ac970d0..9da0a63e14 100644 --- a/src/Observable.ts +++ b/src/Observable.ts @@ -6,11 +6,12 @@ import {Subscription} from './Subscription'; import {root} from './util/root'; import {CoreOperators} from './CoreOperators'; import {SymbolShim} from './util/SymbolShim'; -import {GroupedObservable} from './operator/groupBy-support'; -import {ConnectableObservable} from './observable/ConnectableObservable'; -import {Subject} from './Subject'; import {Notification} from './Notification'; +import {Subject} from './ambient/Subject'; +import {GroupedObservable} from './ambient/GroupedObservable'; +import {ConnectableObservable} from './ambient/ConnectableObservable'; + /** * A representation of any set of values over any amount of time. This the most basic building block * of RxJS. @@ -89,7 +90,7 @@ export class Observable implements CoreOperators { let subscriber: Subscriber; if (observerOrNext && typeof observerOrNext === 'object') { - if (observerOrNext instanceof Subscriber || observerOrNext instanceof Subject) { + if (observerOrNext instanceof Subscriber) { //|| observerOrNext instanceof Subject) { subscriber = (> observerOrNext); } else { subscriber = new Subscriber(> observerOrNext); @@ -255,3 +256,9 @@ export class Observable implements CoreOperators { zip: (...observables: Array | ((...values: Array) => R)>) => Observable; zipAll: (project?: (...values: Array) => R) => Observable; } + +//let import occurs after Observable is exported +import {ArrayObservable} from './observable/fromArray'; + +Observable.fromArray = ArrayObservable.create; +Observable.of = ArrayObservable.of; \ No newline at end of file diff --git a/src/ambient/ConnectableObservable.ts b/src/ambient/ConnectableObservable.ts new file mode 100644 index 0000000000..ac2a80aaa6 --- /dev/null +++ b/src/ambient/ConnectableObservable.ts @@ -0,0 +1 @@ +export interface ConnectableObservable {} \ No newline at end of file diff --git a/src/ambient/GroupedObservable.ts b/src/ambient/GroupedObservable.ts new file mode 100644 index 0000000000..0b57549988 --- /dev/null +++ b/src/ambient/GroupedObservable.ts @@ -0,0 +1 @@ +export interface GroupedObservable {} \ No newline at end of file diff --git a/src/ambient/Observable.ts b/src/ambient/Observable.ts new file mode 100644 index 0000000000..b0678ecdfe --- /dev/null +++ b/src/ambient/Observable.ts @@ -0,0 +1 @@ +export interface Observable {} diff --git a/src/ambient/Subject.ts b/src/ambient/Subject.ts new file mode 100644 index 0000000000..30feb89ab0 --- /dev/null +++ b/src/ambient/Subject.ts @@ -0,0 +1 @@ +export interface Subject {} \ No newline at end of file