refactor(async): refactor EventEmitter

Refactor EventEmitter and Async Facade to match ES7 Observable semantics, properly use RxJS typedefs, make EventEmitter inherit from RxJS Subject. Closes #4149.

BREAKING CHANGE:
- consumers of EventEmitter no longer need to call .toRx()
- EventEmitter is now generic and requires a type - e.g. `EventEmitter<string>`
- EventEmitter and Observable now use the `.subscribe(generatorOrNext, error, complete)` method instead of `.observer(generator)`
- ObservableWrapper uses `callNext/callError/callComplete` instead of `callNext/callThrow/callReturn`
This commit is contained in:
Rob Wormald
2015-10-24 18:48:43 -07:00
parent 72e65d6797
commit ca3986f31d
35 changed files with 341 additions and 113 deletions

View File

@ -79,7 +79,7 @@ export const APP_BASE_HREF: OpaqueToken = CONST_EXPR(new OpaqueToken('appBaseHre
@Injectable()
export class Location {
/** @internal */
_subject: EventEmitter = new EventEmitter();
_subject: EventEmitter<any> = new EventEmitter();
/** @internal */
_baseHref: string;

View File

@ -59,7 +59,7 @@ export class Router {
private _auxRouters = new Map<string, Router>();
private _childRouter: Router;
private _subject: EventEmitter = new EventEmitter();
private _subject: EventEmitter<any> = new EventEmitter();
constructor(public registry: RouteRegistry, public parent: Router, public hostComponent: any) {}