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AC,AA7DD,CAAqC,iBAAO,GA6D3C;AA7DY,oBAAY,eA6DxB,CAAA","sourcesContent":["import {Observable} from 'rxjs/Observable';\nimport {Subject} from 'rxjs/Subject';\nimport {PromiseObservable} from 'rxjs/observable/PromiseObservable';\nimport {toPromise} from 'rxjs/operator/toPromise';\n\nimport {global, noop} from './lang';\n\nexport {Observable} from 'rxjs/Observable';\nexport {Subject} from 'rxjs/Subject';\nexport {PromiseCompleter, PromiseWrapper} from './promise';\n\nexport class TimerWrapper {\n static setTimeout(fn: (...args: any[]) => void, millis: number): number {\n return global.setTimeout(fn, millis);\n }\n static clearTimeout(id: number): void { global.clearTimeout(id); }\n\n static setInterval(fn: (...args: any[]) => void, millis: number): number {\n return global.setInterval(fn, millis);\n }\n static clearInterval(id: number): void { global.clearInterval(id); }\n}\n\nexport class ObservableWrapper {\n // TODO(vsavkin): when we use rxnext, try inferring the generic type from the first arg\n static subscribe<T>(\n emitter: any, onNext: (value: T) => void, onError?: (exception: any) => void,\n onComplete: () => void = () => {}): Object {\n onError = (typeof onError === 'function') && onError || noop;\n onComplete = (typeof onComplete === 'function') && onComplete || noop;\n return emitter.subscribe({next: onNext, error: onError, complete: onComplete});\n }\n\n static isObservable(obs: any): boolean { return !!obs.subscribe; }\n\n /**\n * Returns whether `obs` has any subscribers listening to events.\n */\n static hasSubscribers(obs: EventEmitter<any>): boolean { return obs.observers.length > 0; }\n\n static dispose(subscription: any) { subscription.unsubscribe(); }\n\n /**\n * @deprecated - use callEmit() instead\n */\n static callNext(emitter: EventEmitter<any>, value: any) { emitter.next(value); }\n\n static callEmit(emitter: EventEmitter<any>, value: any) { emitter.emit(value); }\n\n static callError(emitter: EventEmitter<any>, error: any) { emitter.error(error); }\n\n static callComplete(emitter: EventEmitter<any>) { emitter.complete(); }\n\n static fromPromise(promise: Promise<any>): Observable<any> {\n return PromiseObservable.create(promise);\n }\n\n static toPromise(obj: Observable<any>): Promise<any> { return toPromise.call(obj); }\n}\n\n/**\n * Use by directives and components to emit custom Events.\n *\n * ### Examples\n *\n * In the following example, `Zippy` alternatively emits `open` and `close` events when its\n * title gets clicked:\n *\n * ```\n * @Component({\n * selector: 'zippy',\n * template: `\n * <div class=\"zippy\">\n * <div (click)=\"toggle()\">Toggle</div>\n * <div [hidden]=\"!visible\">\n * <ng-content></ng-content>\n * </div>\n * </div>`})\n * export class Zippy {\n * visible: boolean = true;\n * @Output() open: EventEmitter<any> = new EventEmitter();\n * @Output() close: EventEmitter<any> = new EventEmitter();\n *\n * toggle() {\n * this.visible = !this.visible;\n * if (this.visible) {\n * this.open.emit(null);\n * } else {\n * this.close.emit(null);\n * }\n * }\n * }\n * ```\n *\n * The events payload can be accessed by the parameter `$event` on the components output event\n * handler:\n *\n * ```\n * <zippy (open)=\"onOpen($event)\" (close)=\"onClose($event)\"></zippy>\n * ```\n *\n * Uses Rx.Observable but provides an adapter to make it work as specified here:\n * https://github.com/jhusain/observable-spec\n *\n * Once a reference implementation of the spec is available, switch to it.\n * @stable\n */\nexport class EventEmitter<T> extends Subject<T> {\n // TODO: mark this as internal once all the facades are gone\n // we can't mark it as internal now because EventEmitter exported via @angular/core would not\n // contain this property making it incompatible with all the code that uses EventEmitter via\n // facades, which are local to the code and do not have this property stripped.\n // tslint:disable-next-line\n __isAsync: boolean;\n\n /**\n * Creates an instance of [EventEmitter], which depending on [isAsync],\n * delivers events synchronously or asynchronously.\n */\n constructor(isAsync: boolean = false) {\n super();\n this.__isAsync = isAsync;\n }\n\n emit(value: T) { super.next(value); }\n\n /**\n * @deprecated - use .emit(value) instead\n */\n next(value: any) { super.next(value); }\n\n subscribe(generatorOrNext?: any, error?: any, complete?: any): any {\n let schedulerFn: any /** TODO #9100 */;\n let errorFn = (err: any): any /** TODO #9100 */ => null;\n let completeFn = (): any /** TODO #9100 */ => null;\n\n if (generatorOrNext && typeof generatorOrNext === 'object') {\n schedulerFn = this.__isAsync ? (value: any /** TODO #9100 */) => {\n setTimeout(() => generatorOrNext.next(value));\n } : (value: any /** TODO #9100 */) => { generatorOrNext.next(value); };\n\n if (generatorOrNext.error) {\n errorFn = this.__isAsync ? (err) => { setTimeout(() => generatorOrNext.error(err)); } :\n (err) => { generatorOrNext.error(err); };\n }\n\n if (generatorOrNext.complete) {\n completeFn = this.__isAsync ? () => { setTimeout(() => generatorOrNext.complete()); } :\n () => { generatorOrNext.complete(); };\n }\n } else {\n schedulerFn = this.__isAsync ? (value: any /** TODO #9100 */) => {\n setTimeout(() => generatorOrNext(value));\n } : (value: any /** TODO #9100 */) => { generatorOrNext(value); };\n\n if (error) {\n errorFn =\n this.__isAsync ? (err) => { setTimeout(() => error(err)); } : (err) => { error(err); };\n }\n\n if (complete) {\n completeFn =\n this.__isAsync ? () => { setTimeout(() => complete()); } : () => { complete(); };\n }\n }\n\n return super.subscribe(schedulerFn, errorFn, completeFn);\n }\n}\n"]} |