source: trip-planner-front/node_modules/rxjs/src/internal/testing/SubscriptionLoggable.ts@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 635 bytes
Line 
1import { Scheduler } from '../Scheduler';
2import { SubscriptionLog } from './SubscriptionLog';
3
4export class SubscriptionLoggable {
5 public subscriptions: SubscriptionLog[] = [];
6 scheduler: Scheduler;
7
8 logSubscribedFrame(): number {
9 this.subscriptions.push(new SubscriptionLog(this.scheduler.now()));
10 return this.subscriptions.length - 1;
11 }
12
13 logUnsubscribedFrame(index: number) {
14 const subscriptionLogs = this.subscriptions;
15 const oldSubscriptionLog = subscriptionLogs[index];
16 subscriptionLogs[index] = new SubscriptionLog(
17 oldSubscriptionLog.subscribedFrame,
18 this.scheduler.now()
19 );
20 }
21}
Note: See TracBrowser for help on using the repository browser.