Skip to content

Waypoint hooks

Pre-release
Pre-release
Compare
Choose a tag to compare
@poteto poteto released this 25 Apr 03:42
· 396 commits to master since this release

Install the beta and report if you have any issues.

$ ember install [email protected]

This pre-release adds a feature where you can now subscribe to didScroll{Up,Down,Left,Right} hooks that are emitted by the Mixin when the element enters the viewport. This is primarily for the purposes of replacing the waypoints library in ember-waypoints to use an Ember implementation instead.

As with any other hook in Ember, you can handle it with:

export default Ember.Component.extend(InViewportMixin, {
  didScrollUp() {
    console.log('up');
  },

  didScrollDown() {
    console.log('down');
  },

  didScrollLeft() {
    console.log('left');
  },

  didScrollRight() {
    console.log('right');
  }
});
Changelog

#11 waypoint hooks first draft by @poteto