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

[Sentinel] Add support for boolean events #127

Open
titouanmathis opened this issue Apr 19, 2023 · 0 comments
Open

[Sentinel] Add support for boolean events #127

titouanmathis opened this issue Apr 19, 2023 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@titouanmathis
Copy link
Contributor

As of now, we need to listend to the intersected event when using the Sentinel logic:

import { Sentinel } from '@studiometa/ui';

class App extends Base {
  static config = {
    name: 'App',
    components: { 
      Sentinel 
    },
  };

  onSentinelIntersected(entries) {
    if (entries[0].isIntersecting) {
      // do something when the sentinel is visible
    }
  }
}

It would be simpler to listen to dedicated events for both when the sentinel is intersecting and it is not.

  onSentinelVisible(entries) {}
  onSentinelHidden(entries) {}
@titouanmathis titouanmathis self-assigned this Apr 19, 2023
@titouanmathis titouanmathis added the enhancement New feature or request label Apr 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant