@@ -4,14 +4,15 @@ import {global, isPresent, noop} from 'angular2/src/facade/lang';
44import { Promise } from 'angular2/src/facade/promise' ;
55export { PromiseWrapper , Promise , PromiseCompleter } from 'angular2/src/facade/promise' ;
66
7+ import { Observable } from 'rxjs/Observable' ;
78import { Subject } from 'rxjs/Subject' ;
8- import { Observable as RxObservable } from 'rxjs/Observable' ;
99import { Subscription } from 'rxjs/Subscription' ;
1010import { Operator } from 'rxjs/Operator' ;
1111
1212import { PromiseObservable } from 'rxjs/observable/fromPromise' ;
1313import { toPromise } from 'rxjs/operator/toPromise' ;
1414
15+ export { Observable } from 'rxjs/Observable' ;
1516export { Subject } from 'rxjs/Subject' ;
1617
1718export namespace NodeJS {
@@ -160,74 +161,4 @@ export class EventEmitter<T> extends Subject<T> {
160161
161162 return super . subscribe ( schedulerFn , errorFn , completeFn ) ;
162163 }
163- }
164-
165- /**
166- * Allows publishing and subscribing to series of async values.
167- *
168- * The `Observable` class is an alias to the `Observable` returned from
169- * {@link https://github.com/reactivex/rxjs}. `Observables` are a means of delivering
170- * any number of values over any period of time. `Observables` can be thought of as a
171- * mixture of `Promise` and `Array`. `Observables` are like `Arrays` in that they can have
172- * chained combinators -- like `map`, `reduce`, and `filter` -- attached in order to
173- * perform projections and transformations of data. And they are like `Promises`
174- * in that they can asynchronously deliver values. But unlike a `Promise`, an
175- * `Observable` can emit many values over time, and decides if/when it is completed.
176- *
177- * `Observable` is also being considered for inclusion in the
178- * [ECMAScript spec](https://github.com/zenparsing/es-observable).
179- *
180- * ## Example
181- *
182- * A simple example of using an `Observable` is a timer `Observable`, which will
183- * notify an `Observer` each time an interval has completed.
184- *
185- * {@example facade/ts/async/observable.ts region='Observable'}
186- *
187- * The `Observable` in Angular currently doesn't provide any combinators by default.
188- * So it's necessary to explicitly import any combinators that an application requires.
189- * There are two ways to import RxJS combinators: pure and patched. The "pure" approach
190- * involves importing a combinator as a function every place that an application needs it,
191- * then calling the function with the source observable as the context of the function.
192- *
193- * ## Example
194- *
195- * {@example facade/ts/async/observable_pure.ts region='Observable'}
196- *
197- * The "patched" approach to using combinators is to import a special module for
198- * each combinator, which will automatically cause the combinator to be patched
199- * to the `Observable` prototype, which will make it available to use anywhere in
200- * an application after the combinator has been imported once.
201- *
202- * ## Example
203- *
204- * (Notice the extra "add" in the path to import `map`)
205- *
206- * {@example facade/ts/async/observable_patched.ts region='Observable'}
207- *
208- * Notice that the sequence of operations is now able to be expressed "left-to-right"
209- * because `map` is on the `Observable` prototype. For a simple example like this one,
210- * the left-to-right expression may seem insignificant. However, when several operators
211- * are used in combination, the "callback tree" grows several levels deep, and becomes
212- * difficult to read. For this reason, the "patched" approach is the recommended approach
213- * to add new operators to `Observable`.
214- *
215- * For applications that are less sensitive about payload size, the set of core operators
216- * can be patched onto the `Observable` prototype with a single import, by importing the
217- * `rxjs` module.
218- *
219- * {@example facade/ts/async/observable_all.ts region='Observable'}
220- *
221- * Full documentation on RxJS `Observable` and available combinators can be found
222- * in the RxJS [Observable docs](http://reactivex.io/RxJS/class/es6/Observable.js~Observable.html).
223- *
224- */
225- // todo(robwormald): ts2dart should handle this properly
226- export class Observable < T > extends RxObservable < T > {
227- lift < T , R > ( operator : Operator < T , R > ) : Observable < T > {
228- const observable = new Observable ( ) ;
229- observable . source = this ;
230- observable . operator = operator ;
231- return observable ;
232- }
233- }
164+ }
0 commit comments