Skip to content

Instantly share code, notes, and snippets.

@lloydjatkinson
Last active October 8, 2020 16:39
Show Gist options
  • Save lloydjatkinson/23e4289f93759eef351d1e3eee137d4f to your computer and use it in GitHub Desktop.
Save lloydjatkinson/23e4289f93759eef351d1e3eee137d4f to your computer and use it in GitHub Desktop.
computed: {
hasScrolledNearEnd () {
return !inRange(this.scrollView.endIndex, this.notifications.length - 5);
},
},
watch: {
hasScrolledNearEnd (nearEnd, previousValue) {
if (nearEnd && !previousValue) {
this.updateNotifications();
}
},
},
methods: {
...mapActions('NotificationsModule', [
'updateNotifications',
]),
update (startIndex, endIndex) {
this.scrollView.startIndex = startIndex;
this.scrollView.endIndex = endIndex;
},
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment