Skip to content

Commit 9ed0298

Browse files
committed
Move event cache into HTKEventBase, so it's available for all events
1 parent 9acf2b7 commit 9ed0298

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

src/model/events/event-base.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,9 @@ export abstract class HTKEventBase {
3838
@observable
3939
public pinned: boolean = false;
4040

41+
// Logic elsewhere can put values into these caches to cache calculations
42+
// about this event weakly, so they GC with the event.
43+
// Keyed by symbols only, so we know we never have conflicts.
44+
public cache = observable.map(new Map<symbol, unknown>(), { deep: false });
45+
4146
}

src/model/http/exchange.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,6 @@ export class HttpExchange extends HTKEventBase {
217217
this._apiMetadataPromise = apiStore.getApi(this.request);
218218
}
219219

220-
// Logic elsewhere can put values into these caches to cache calculations
221-
// about this exchange weakly, so they GC with the exchange.
222-
// Keyed by symbols only, so we know we never have conflicts.
223-
public cache = observable.map(new Map<symbol, unknown>(), { deep: false });
224-
225220
public readonly request: HtkRequest;
226221
public readonly id: string;
227222

src/model/webrtc/rtc-connection.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ export class RTCConnection extends HTKEventBase {
2727

2828
readonly id = this.connectionEvent.sessionId;
2929

30-
public readonly cache = observable.map(new Map<symbol, unknown>(), { deep: false });
31-
3230
isRTCConnection(): this is RTCConnection {
3331
return true;
3432
}

0 commit comments

Comments
 (0)