-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pingback implementation #1294
Pingback implementation #1294
Conversation
} | ||
|
||
/** | ||
* @return {!Promise} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, maybe add doc:
The promise will be resolved when a view of this document has occurred. It will be rejected if the current render should not be counted as a view.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@cramforce All done. PTAL. |
/** @private {!Promise<string>|undefined} */ | ||
this.readerIdPromise_ = undefined; | ||
|
||
/** @private {!Promise|undefined} */ | ||
this.reportViewPromise_ = undefined; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there for a reason for preferring undefined
over null
? The type hint could be shorter with {?Promise}
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, in this case undefined/null doesn't matter. I switched to null
LGTM with one stylistic comment from Justin remaining. |
// condition and when the document becomes invisible again. | ||
let resolve, reject; | ||
const promise = new Promise((aResolve, aReject) => { | ||
resolve = aResolve; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All the registering below could be wrapped into this resolver to avoid the deferred pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
No description provided.