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EAAE,GAAG,CAAC,CAAC;IAC/C,CAAC;IAED;;;OAGG;IACI,2BAAc,GAArB;QACE,MAAM,CAAC,YAAY,CAAC,oBAAoB,CAAC;IAC3C,CAAC;IAlCc,iCAAoB,GAAsB,IAAI,YAAY,CAAC,GAAG,CAAC,CAAC;IAChE,uCAA0B,GAAsB,IAAI,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;IAkClG,mBAAC;AAAD,CAAC,AAjHD,IAiHC;AAjHY,oBAAY,eAiHxB,CAAA","sourcesContent":["import { PartialObserver } from './Observer';\nimport { Observable } from './Observable';\n\n/**\n * Represents a push-based event or value that an {@link Observable} can emit.\n * This class is particularly useful for operators that manage notifications,\n * like {@link materialize}, {@link dematerialize}, {@link observeOn}, and\n * others. Besides wrapping the actual delivered value, it also annotates it\n * with metadata of, for instance, what type of push message it is (`next`,\n * `error`, or `complete`).\n *\n * @see {@link materialize}\n * @see {@link dematerialize}\n * @see {@link observeOn}\n *\n * @class Notification<T>\n */\nexport class Notification<T> {\n hasValue: boolean;\n\n constructor(public kind: string, public value?: T, public error?: any) {\n this.hasValue = kind === 'N';\n }\n\n /**\n * Delivers to the given `observer` the value wrapped by this Notification.\n * @param {Observer} observer\n * @return\n */\n observe(observer: PartialObserver<T>): any {\n switch (this.kind) {\n case 'N':\n return observer.next && observer.next(this.value);\n case 'E':\n return observer.error && observer.error(this.error);\n case 'C':\n return observer.complete && observer.complete();\n }\n }\n\n /**\n * Given some {@link Observer} callbacks, deliver the value represented by the\n * current Notification to the correctly corresponding callback.\n * @param {function(value: T): void} next An Observer `next` callback.\n * @param {function(err: any): void} [error] An Observer `error` callback.\n * @param {function(): void} [complete] An Observer `complete` callback.\n * @return {any}\n */\n
|