From 2c2b84d31dbe906b89dfb995394d887af110e04c Mon Sep 17 00:00:00 2001 From: Henry Jameson Date: Fri, 5 Jul 2019 10:02:14 +0300 Subject: npm eslint --fix . --- src/hocs/with_subscription/with_subscription.js | 68 ++++++++++++------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'src/hocs/with_subscription/with_subscription.js') diff --git a/src/hocs/with_subscription/with_subscription.js b/src/hocs/with_subscription/with_subscription.js index 679409cf..91fc4cca 100644 --- a/src/hocs/with_subscription/with_subscription.js +++ b/src/hocs/with_subscription/with_subscription.js @@ -4,10 +4,10 @@ import { getComponentProps } from '../../services/component_utils/component_util import './with_subscription.scss' const withSubscription = ({ - fetch, // function to fetch entries and return a promise - select, // function to select data from store - childPropName = 'content', // name of the prop to be passed into the wrapped component - additionalPropNames = [] // additional prop name list of the wrapper component + fetch, // function to fetch entries and return a promise + select, // function to select data from store + childPropName = 'content', // name of the prop to be passed into the wrapped component + additionalPropNames = [] // additional prop name list of the wrapper component }) => (WrappedComponent) => { const originalProps = Object.keys(getComponentProps(WrappedComponent)) const props = originalProps.filter(v => v !== childPropName).concat(additionalPropNames) @@ -15,37 +15,8 @@ const withSubscription = ({ return Vue.component('withSubscription', { props: [ ...props, - 'refresh' // boolean saying to force-fetch data whenever created + 'refresh' // boolean saying to force-fetch data whenever created ], - render (createElement) { - if (!this.error && !this.loading) { - const props = { - props: { - ...this.$props, - [childPropName]: this.fetchedData - }, - on: this.$listeners, - scopedSlots: this.$scopedSlots - } - const children = Object.entries(this.$slots).map(([key, value]) => createElement('template', { slot: key }, value)) - return ( -
- - {children} - -
- ) - } else { - return ( -
- {this.error - ? {this.$t('general.generic_error')} - : - } -
- ) - } - }, data () { return { loading: false, @@ -77,6 +48,35 @@ const withSubscription = ({ }) } } + }, + render (createElement) { + if (!this.error && !this.loading) { + const props = { + props: { + ...this.$props, + [childPropName]: this.fetchedData + }, + on: this.$listeners, + scopedSlots: this.$scopedSlots + } + const children = Object.entries(this.$slots).map(([key, value]) => createElement('template', { slot: key }, value)) + return ( +
+ + {children} + +
+ ) + } else { + return ( +
+ {this.error + ? {this.$t('general.generic_error')} + : + } +
+ ) + } } }) } -- cgit v1.2.3-70-g09d2