load feed of give records on home screen
This commit is contained in:
@@ -14,6 +14,7 @@ export default class InfiniteScroll extends Vue {
|
||||
readonly distance!: number;
|
||||
private observer!: IntersectionObserver;
|
||||
|
||||
// 'mounted' hook runs after initial render
|
||||
mounted() {
|
||||
const options = {
|
||||
root: this.$refs.scrollContainer as HTMLElement,
|
||||
@@ -24,6 +25,7 @@ export default class InfiniteScroll extends Vue {
|
||||
this.observer.observe(this.$refs.sentinel as HTMLElement);
|
||||
}
|
||||
|
||||
// 'beforeUnmount' hook runs before unmounting the component
|
||||
beforeUnmount() {
|
||||
this.observer.disconnect();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user