aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/src/internal/testing/SubscriptionLoggable.ts
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/rxjs/src/internal/testing/SubscriptionLoggable.ts')
-rw-r--r--node_modules/rxjs/src/internal/testing/SubscriptionLoggable.ts22
1 files changed, 22 insertions, 0 deletions
diff --git a/node_modules/rxjs/src/internal/testing/SubscriptionLoggable.ts b/node_modules/rxjs/src/internal/testing/SubscriptionLoggable.ts
new file mode 100644
index 0000000..e8def04
--- /dev/null
+++ b/node_modules/rxjs/src/internal/testing/SubscriptionLoggable.ts
@@ -0,0 +1,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