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

Expose intersectionRatio value to callback and render fns #123

Closed
wants to merge 1 commit into from

Conversation

jamesism
Copy link

What do you think about exposing the intersectionRatio returned in the latest IntersectionObserver callback to the render function and onChange callback? Pretty small change, gives support for a different set of use cases.

Let me know what you think, and if you're down I can update README etc as well before merge.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 453

  • 5 of 5 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 95.783%

Totals Coverage Status
Change from base Build 444: 0.0%
Covered Lines: 81
Relevant Lines: 81

💛 - Coveralls

@thebuilder
Copy link
Owner

That would be great.👍

I haven't had the need for it, but it does makes sense to receive the ratio when working with an array of thresholds, so you know the trigger point. Keep in mind that the ratio won't match the threshold values, so you can't directly compare the values.

The .d.ts file should also be updated with the new interface.

@steinbergh
Copy link

This being pulled in with updated types is exactly what im looking for

@thebuilder
Copy link
Owner

Made some local changes to the typescript definition, and added it to a new pull request.

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.

4 participants