-
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
add amp-live-list manager #3094
add amp-live-list manager #3094
Conversation
29211fe
to
c1f6a9f
Compare
@dvoytenko PTAL |
e8cba50
to
e49b2ab
Compare
cc @cramforce |
// Polling should always be stopped when document is no longer visible. | ||
this.viewer_.onVisibilityChanged(() => { | ||
if (this.viewer_.isVisible()) { | ||
this.poller_.start(); |
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.
Does this trigger an immediate invocation?
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.
it does not, it would queue up a timeout (with jitter).
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.
The design doc says to do it, so that the time since last poll is taken into account.
I think that is pretty important. Basically when you return to a page after 5 minutes you want an immediate update.
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.
makes sense, will fix
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.
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.
added opt_isLeading
param to start
.
Looks great. A few questions/comments. |
c744338
to
53192c9
Compare
// Polling should always be stopped when document is no longer visible. | ||
this.viewer_.onVisibilityChanged(() => { | ||
if (this.viewer_.isVisible()) { | ||
this.poller_.start(true); |
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.
Add comment for what the true means.
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.
a3534a0
to
b6ac7ea
Compare
@cramforce PTAL |
LGTM |
b6ac7ea
to
e09457d
Compare
e09457d
to
5764bc2
Compare
Add amp-live-list manager that handles the request/response cycle if there are multiple amp-live-list instances on a document.