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

export 'observe' from '/observers' ? #402

Closed
D10221 opened this issue Oct 16, 2020 · 5 comments · Fixed by #473
Closed

export 'observe' from '/observers' ? #402

D10221 opened this issue Oct 16, 2020 · 5 comments · Fixed by #473

Comments

@D10221
Copy link

D10221 commented Oct 16, 2020

Hi,

First , thank you !.

I think the "observe" implementation is the hidden gem here :)
Would you consider exporting it ?

Thanks again.

@thebuilder
Copy link
Owner

It is powerful.
I think my main concern is that it exposes the "internals" of the library. Suddenly any changes to observer could be considered breaking changes.

@D10221
Copy link
Author

D10221 commented Oct 17, 2020

As far as you keep the signature :)

observe(element: Element,  callback: ObserverInstanceCallback,  options: IntersectionObserverInit = {}) => void

To be honest, my initial thought was that it should be on its own lib/namespace.
it's only dependency is 'IntersectionObserver'

@ValeryLosik
Copy link

Hi, I also want to thank you for this great project. Currently, we have started using IntersectionObserver in our application and we were searching for good react solution for it. But we also need more low-level API for IntersectionObserver, (e.g. when we work with refs and we don't want to run whole reconciliation cycle) and observe fits ideally.

@thebuilder
Copy link
Owner

Alright, good to know. Would need to be detailed in the readme file if added, as a low level option.

@thebuilder
Copy link
Owner

Closed by #473

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 a pull request may close this issue.

3 participants