Skip to content

Commit 21def05

Browse files
committed
add comments
1 parent cb10086 commit 21def05

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

packages/core/src/utils-hoist/syncpromise.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ export class SyncPromise<T> implements PromiseLike<T> {
5858
this._state = States.PENDING;
5959
this._handlers = [];
6060

61+
// We set this functions here as class properties, to make binding them easier
62+
// This way, the `this` context is easier to maintain
6163
this._resolve = (value?: T | PromiseLike<T> | null) => {
6264
this._setResult(States.RESOLVED, value);
6365
};

packages/replay-internal/src/replay.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,7 @@ export class ReplayContainer implements ReplayContainerInterface {
235235
});
236236
}
237237

238+
// We set these handler properties as class properties, to make binding/unbinding them easier
238239
this._handleVisibilityChange = () => {
239240
if (WINDOW.document.visibilityState === 'visible') {
240241
this._doChangeToForegroundTasks();

0 commit comments

Comments
 (0)