Skip to content

Commit c001286

Browse files
alan-agius4atscott
authored andcommitted
refactor(core): a couple of minor changes to the early-event-contract (angular#55704)
This changes include - Using multi line comments to write JSDoc comments which improves DX - Use `this.container` instead of `window.document.documentElement` PR Close angular#55704
1 parent fb54863 commit c001286

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

packages/core/primitives/event-dispatch/src/earlyeventcontract.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ export declare interface EarlyJsactionDataContainer {
1616
* Defines the early jsaction data types.
1717
*/
1818
export declare interface EarlyJsactionData {
19-
// List used to keep track of the early JSAction event types.
19+
/** List used to keep track of the early JSAction event types. */
2020
et: string[];
2121

22-
// List used to keep track of capture event types.
22+
/** List used to keep track of capture event types. */
2323
etc: string[];
2424

25-
// List used to keep track of the JSAction events if using earlyeventcontract.
25+
/** List used to keep track of the JSAction events if using earlyeventcontract. */
2626
q: EventInfo[];
2727

28-
// Early Jsaction handler
28+
/** Early Jsaction handler. */
2929
h: (event: Event) => void;
3030

31-
// Container for listening to events
31+
/** Container for listening to events. */
3232
c: HTMLElement;
3333
}
3434

@@ -42,7 +42,7 @@ export class EarlyEventContract {
4242
private readonly replaySink: EarlyJsactionDataContainer = window as EarlyJsactionDataContainer,
4343
private readonly container = window.document.documentElement,
4444
) {
45-
this.replaySink._ejsa = {
45+
replaySink._ejsa = {
4646
c: container,
4747
q: [],
4848
et: [],
@@ -52,10 +52,10 @@ export class EarlyEventContract {
5252
event.type,
5353
event,
5454
event.target as Element,
55-
window.document.documentElement,
55+
container,
5656
Date.now(),
5757
);
58-
this.replaySink._ejsa!.q.push(eventInfo);
58+
replaySink._ejsa!.q.push(eventInfo);
5959
},
6060
};
6161
}

0 commit comments

Comments
 (0)