Last active
October 8, 2020 16:39
-
-
Save lloydjatkinson/23e4289f93759eef351d1e3eee137d4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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