aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authortaehoon <th.dev91@gmail.com>2019-02-13 22:52:57 -0500
committertaehoon <th.dev91@gmail.com>2019-02-20 13:30:30 -0500
commitf81b82b4714643ba396b69ca54b97259a36a6b9f (patch)
tree2918dd22f091766ee87b96d79a0dcacdbc858274 /src/components
parent8f608e060c813dc6d9aeeb548beca971ce9b74bd (diff)
Use hoc definitions to be factor of factory
Diffstat (limited to 'src/components')
-rw-r--r--src/components/user_settings/user_settings.js26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/components/user_settings/user_settings.js b/src/components/user_settings/user_settings.js
index 8114d5e2..21023841 100644
--- a/src/components/user_settings/user_settings.js
+++ b/src/components/user_settings/user_settings.js
@@ -10,21 +10,19 @@ import MuteCard from '../mute_card/mute_card.vue'
import withSubscription from '../../hocs/with_subscription/with_subscription'
import withList from '../../hocs/with_list/with_list'
-const BlockList = withList(BlockCard, userId => ({ userId }))
-const BlockListWithSubscription = withSubscription(
- BlockList,
- (props, $store) => $store.dispatch('fetchBlocks'),
- (props, $store) => get($store.state.users.currentUser, 'blockIds', []),
- 'entries'
-)
+const BlockList = withList({ getEntryProps: userId => ({ userId }) })(BlockCard)
+const BlockListWithSubscription = withSubscription({
+ fetch: (props, $store) => $store.dispatch('fetchBlocks'),
+ select: (props, $store) => get($store.state.users.currentUser, 'blockIds', []),
+ contentPropName: 'entries'
+})(BlockList)
-const MuteList = withList(MuteCard, userId => ({ userId }))
-const MuteListWithSubscription = withSubscription(
- MuteList,
- (props, $store) => $store.dispatch('fetchMutes'),
- (props, $store) => get($store.state.users.currentUser, 'muteIds', []),
- 'entries'
-)
+const MuteList = withList({ getEntryProps: userId => ({ userId }) })(MuteCard)
+const MuteListWithSubscription = withSubscription({
+ fetch: (props, $store) => $store.dispatch('fetchMutes'),
+ select: (props, $store) => get($store.state.users.currentUser, 'muteIds', []),
+ contentPropName: 'entries'
+})(MuteList)
const UserSettings = {
data () {