Skip to content
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

Merged
merged 1 commit into from Jan 5, 2016
Merged

Pingback implementation #1294

merged 1 commit into from Jan 5, 2016

Conversation

dvoytenko
Copy link
Contributor

No description provided.

}

/**
* @return {!Promise}
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@dvoytenko
Copy link
Contributor Author

@cramforce All done. PTAL.

/** @private {!Promise<string>|undefined} */
this.readerIdPromise_ = undefined;

/** @private {!Promise|undefined} */
this.reportViewPromise_ = undefined;
Copy link
Contributor

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}...

Copy link
Contributor Author

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

@cramforce
Copy link
Member

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;
Copy link
Contributor

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

dvoytenko added a commit that referenced this pull request Jan 5, 2016
@dvoytenko dvoytenko merged commit 26d7cd7 into ampproject:master Jan 5, 2016
@dvoytenko dvoytenko deleted the access5 branch January 5, 2016 23:38
@dparikh dparikh mentioned this pull request Oct 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants