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

Internal: Update IntersectionObserverAdmin + simplify #184

Merged
merged 1 commit into from Apr 20, 2019

Conversation

snewcomer
Copy link
Collaborator

This update adds the ability register callbacks with intersection observer admin. Eventually will try to return outan instance and allow end user to add the callback function.

snewcomer/intersection-observer-admin#5

@snewcomer snewcomer self-assigned this Apr 20, 2019
@snewcomer snewcomer changed the title Update IntersectionObserverAdmin + simplify Internal: Update IntersectionObserverAdmin + simplify Apr 20, 2019
return this.ioAdmin.observe(...args);
add(element, observerOptions, enterCallback, exitCallback) {
if (enterCallback) {
this.instance.addEnterCallback(element, enterCallback);
Copy link
Collaborator Author

@snewcomer snewcomer Apr 20, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could add an API to this class such as addEnterCallback with an element && function. The user would need to so something like inViewport.addEnterCallback(element, callback) with the service. When the element intersects or exists, we (internal library) dispatches an event to call that callback. This would allow us to be tied only as a mixin.

@snewcomer snewcomer merged commit ad0f789 into master Apr 20, 2019
@snewcomer snewcomer deleted the sn/new-intersection-admin branch April 20, 2019 23:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant