From 76a2e6befb3aea6e890bb3c2e001a4635d05091a Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Sun, 25 Apr 2021 12:50:17 +0300 Subject: [PATCH] remove Vue.component from hooks --- .../with_load_more/{with_load_more.js => with_load_more.jsx} | 2 +- .../{with_subscription.js => with_subscription.jsx} | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) rename src/hocs/with_load_more/{with_load_more.js => with_load_more.jsx} (99%) rename src/hocs/with_subscription/{with_subscription.js => with_subscription.jsx} (97%) diff --git a/src/hocs/with_load_more/with_load_more.js b/src/hocs/with_load_more/with_load_more.jsx similarity index 99% rename from src/hocs/with_load_more/with_load_more.js rename to src/hocs/with_load_more/with_load_more.jsx index 537f5720..7f491558 100644 --- a/src/hocs/with_load_more/with_load_more.js +++ b/src/hocs/with_load_more/with_load_more.jsx @@ -38,7 +38,7 @@ const withLoadMore = ({ this.fetchEntries() } }, - destroyed () { + unmounted () { window.removeEventListener('scroll', this.scrollLoad) destroy && destroy(this.$props, this.$store) }, diff --git a/src/hocs/with_subscription/with_subscription.js b/src/hocs/with_subscription/with_subscription.jsx similarity index 97% rename from src/hocs/with_subscription/with_subscription.js rename to src/hocs/with_subscription/with_subscription.jsx index b1244276..7e590f73 100644 --- a/src/hocs/with_subscription/with_subscription.js +++ b/src/hocs/with_subscription/with_subscription.jsx @@ -1,4 +1,3 @@ -import Vue from 'vue' import isEmpty from 'lodash/isEmpty' import { getComponentProps } from '../../services/component_utils/component_utils' import './with_subscription.scss' @@ -22,7 +21,7 @@ const withSubscription = ({ const originalProps = Object.keys(getComponentProps(WrappedComponent)) const props = originalProps.filter(v => v !== childPropName).concat(additionalPropNames) - return Vue.component('withSubscription', { + return { props: [ ...props, 'refresh' // boolean saying to force-fetch data whenever created @@ -88,7 +87,7 @@ const withSubscription = ({ ) } } - }) + } } export default withSubscription