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

Feature request: viewableThreshold above 1 #79

Open
Fumler opened this issue Apr 18, 2018 · 1 comment
Open

Feature request: viewableThreshold above 1 #79

Fumler opened this issue Apr 18, 2018 · 1 comment

Comments

@Fumler
Copy link

Fumler commented Apr 18, 2018

Hello.

Great library! Just wondering if there are any plans to allow viewableThreshold to be more than 1? We would like to start loading our ads a bit before they are actually in the viewport.

A solution could be to just wrap the ad in a lazyload component, but seeing as you already have the logic for checking if its in the viewport I thought it might be better to allow for it in your component.

What do you think?

@potench
Copy link
Contributor

potench commented Apr 19, 2018

I believe it would need to be a different property since viewableThreshold is a measure of the area of the ad within the viewable area. We'd need to measure the proximity of the ad to the viewable area. And I'm wondering if there are other use cases for determining ad-load intent.

Check out

foldCheck() {
This is calling isInViewport (https://github.com/nfl/react-gpt/blob/17c8b89a05209135968bb9a3447274524f1b5925/src/utils/isInViewport.js)
I think we can riff of this and the logic is pretty simple, but I'm not sure overloading viewableThreshold makes sense. Will come back with proposal later today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants