From 080786c9458ba8b9db1ea63732824a3e297e10dc Mon Sep 17 00:00:00 2001
From: taehoon
Date: Mon, 25 Feb 2019 04:51:23 -0500
Subject: Rewrite FollowList using hocs
---
src/hocs/with_load_more/with_load_more.js | 2 ++
1 file changed, 2 insertions(+)
(limited to 'src/hocs')
diff --git a/src/hocs/with_load_more/with_load_more.js b/src/hocs/with_load_more/with_load_more.js
index 7d53e7ac..b8246ec9 100644
--- a/src/hocs/with_load_more/with_load_more.js
+++ b/src/hocs/with_load_more/with_load_more.js
@@ -7,6 +7,7 @@ import './with_load_more.scss'
const withLoadMore = ({
fetch, // function to fetch entries and return a promise
select, // function to select data from store
+ destroy, // function called at "destroyed" lifecycle
childPropName = 'entries', // name of the prop to be passed into the wrapped component
additionalPropNames = [] // additional prop name list of the wrapper component
}) => (WrappedComponent) => {
@@ -58,6 +59,7 @@ const withLoadMore = ({
},
destroyed () {
window.removeEventListener('scroll', this.scrollLoad)
+ destroy && destroy(this.$props, this.$store)
},
methods: {
fetchEntries () {
--
cgit v1.2.3-70-g09d2