aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/src/internal/testing/SubscriptionLoggable.ts
blob: e8def0419f7e643efdc2925325936c8677b8a141 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import { Scheduler } from '../Scheduler';
import { SubscriptionLog } from './SubscriptionLog';

export class SubscriptionLoggable {
  public subscriptions: SubscriptionLog[] = [];
  // @ts-ignore: Property has no initializer and is not definitely assigned
  scheduler: Scheduler;

  logSubscribedFrame(): number {
    this.subscriptions.push(new SubscriptionLog(this.scheduler.now()));
    return this.subscriptions.length - 1;
  }

  logUnsubscribedFrame(index: number) {
    const subscriptionLogs = this.subscriptions;
    const oldSubscriptionLog = subscriptionLogs[index];
    subscriptionLogs[index] = new SubscriptionLog(
      oldSubscriptionLog.subscribedFrame,
      this.scheduler.now()
    );
  }
}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage