diff options
| author | taehoon <th.dev91@gmail.com> | 2019-02-13 22:52:57 -0500 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-02-20 13:30:30 -0500 |
| commit | f81b82b4714643ba396b69ca54b97259a36a6b9f (patch) | |
| tree | 2918dd22f091766ee87b96d79a0dcacdbc858274 /src/hocs/with_subscription | |
| parent | 8f608e060c813dc6d9aeeb548beca971ce9b74bd (diff) | |
Use hoc definitions to be factor of factory
Diffstat (limited to 'src/hocs/with_subscription')
| -rw-r--r-- | src/hocs/with_subscription/with_subscription.js | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/hocs/with_subscription/with_subscription.js b/src/hocs/with_subscription/with_subscription.js index 633517e3..21630b40 100644 --- a/src/hocs/with_subscription/with_subscription.js +++ b/src/hocs/with_subscription/with_subscription.js @@ -4,8 +4,8 @@ import isEmpty from 'lodash/isEmpty' import omit from 'lodash/omit' import './with_subscription.scss' -const withSubscription = (Component, fetch, select, contentPropName = 'content') => { - const originalProps = Component.props || [] +const withSubscription = ({ fetch, select, contentPropName = 'content' }) => (WrapperComponent) => { + const originalProps = WrapperComponent.props || [] const props = reject(originalProps, v => v === 'content') return Vue.component('withSubscription', { @@ -19,7 +19,7 @@ const withSubscription = (Component, fetch, select, contentPropName = 'content') } return ( <div class="with-subscription"> - {!this.error && !this.loading && <Component {...props} />} + {!this.error && !this.loading && <WrapperComponent {...props} />} <div class="with-subscription-footer"> {this.error && <a onClick={this.fetchData} class="alert error">{this.$t('general.generic_error')}</a>} {!this.error && this.loading && <i class="icon-spin3 animate-spin"/>} |
