From f81b82b4714643ba396b69ca54b97259a36a6b9f Mon Sep 17 00:00:00 2001
From: taehoon
Date: Wed, 13 Feb 2019 22:52:57 -0500
Subject: Use hoc definitions to be factor of factory
---
src/hocs/with_list/with_list.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
(limited to 'src/hocs/with_list/with_list.js')
diff --git a/src/hocs/with_list/with_list.js b/src/hocs/with_list/with_list.js
index 5ec37a2b..c31cdcb1 100644
--- a/src/hocs/with_list/with_list.js
+++ b/src/hocs/with_list/with_list.js
@@ -4,8 +4,8 @@ import map from 'lodash/map'
const defaultEntryPropsGetter = entry => ({ entry })
const defaultKeyGetter = entry => entry.id
-const withList = (Component, getEntryProps = defaultEntryPropsGetter, getKey = defaultKeyGetter) => {
- return Vue.component('withList', {
+const withList = ({ getEntryProps = defaultEntryPropsGetter, getKey = defaultKeyGetter }) => (ItemComponent) => (
+ Vue.component('withList', {
render (createElement) {
return (
@@ -18,13 +18,13 @@ const withList = (Component, getEntryProps = defaultEntryPropsGetter, getKey = d
},
on: this.$props.entryListeners
}
- return
+ return
})}
)
},
props: ['entries', 'entryProps', 'entryListeners']
})
-}
+)
export default withList
--
cgit v1.2.3-70-g09d2