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AAO,CAAC,UAAU,CAAC,CAAC;YAAC,CAAC,EAC9F,OAAO,CAAC,KAAK,EACb,EAAC,gBAAO,EAAE,sBAAU,EAAC,CAAC,CACzB,CAAC;QACJ,CAAC;IACH,CAAC;IACH,qBAAC;AAAD,CAAC,AA/BD,CAAuC,uBAAU,GA+BhD;AA/BY,sBAAc,iBA+B1B,CAAA;AACD,yBAAW,CAAC,cAAc,EAAE,CAAC,2CAAoB,CAAC,CAAC,CAAC","sourcesContent":["import { Observable } from '../Observable';\nimport { Subscription } from '../Subscription';\nimport { Scheduler } from '../Scheduler';\nimport { TestMessage } from './TestMessage';\nimport { SubscriptionLog } from './SubscriptionLog';\nimport { SubscriptionLoggable } from './SubscriptionLoggable';\nimport { applyMixins } from '../util/applyMixins';\nimport { Subscriber } from '../Subscriber';\n\n/**\n * We need this JSDoc comment for affecting ESDoc.\n * @ignore\n * @extends {Ignored}\n */\nexport class ColdObservable<T> extends Observable<T> implements SubscriptionLoggable {\n public subscriptions: SubscriptionLog[] = [];\n scheduler: Scheduler;\n logSubscribedFrame: () => number;\n logUnsubscribedFrame: (index: number) => void;\n\n constructor(public messages: TestMessage[],\n scheduler: Scheduler) {\n super(function (this: ColdObservable<T>, subscriber: Subscriber<any>) {\n const observable: ColdObservable<T> = this;\n const index = observable.logSubscribedFrame();\n subscriber.add(new Subscription(() => {\n observable.logUnsubscribedFrame(index);\n }));\n observable.scheduleMessages(subscriber);\n return subscriber;\n });\n this.scheduler = scheduler;\n }\n\n scheduleMessages(subscriber: Subscriber<any>) {\n const messagesLength = this.messages.length;\n for (let i = 0; i < messagesLength; i++) {\n const message = this.messages[i];\n subscriber.add(\n this.scheduler.schedule(({message, subscriber}) => { message.notification.observe(subscriber); },\n message.frame,\n {message, subscriber})\n );\n }\n }\n}\napplyMixins(ColdObservable, [SubscriptionLoggable]);\n"]} |