-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Added docs for #2562 #822
Added docs for #2562 #822
Conversation
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.
Sorry - while I get the general request for flexibility here, don't fully follow how this would be utilized. Please provide an example use case in this doc.
Do you mean something like this https://github.com/prebid/Prebid.js/pull/2562/files#diff-f8e049a1b6d4f9aa96fca41d2f7aa11dR159 or a new example file ? |
I mean a short example illustrating it's use. Not the implementation. Doesn't have to be a separate file. |
@ptomasroos -- anything else you can provide as to the use of this feature? |
Yeah of course. We use it infinite scrolling when we don’t know what the div will be named at the point of when a auction is finished. Since someone might have scrolled in the list. Then we use that to map to what’s visible in the viewport @bretg |
Ok @ptomasroos - I took a stab at reverse engineering what's happening here enough to come up with an example that made more sense to me than "return slot => { return adUnitCode => { return slot.getSlotElementId() === 'myFavoriteDivId'; } };" Sorry, I'm slow on this -- functional programming is not my forte.
Is the function below a realistic use case?
|
Sorry for forgetting this! Will reply today |
This is more a realistic description @bretg Does it make sense?
|
The reason why this exists is to allow greater flexibility in order to decide when the auction has finished in which div id "placeholder" the ad results should render into. Since a auction may have a init time of xxx ms and then also run for xxxx ms. This closes the gap in some design decisions in order to avoid having to set the timeout of auctions so short to make sure they get good viewability. Instead the logic can find a good placement for the auction result depending on where the user is at and how much time the auction took to complete. |
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.
thanks - makes sense now. Added some words describing the use case.
prebid/Prebid.js#2562 @mkendall07