Rename some options and add comments to HOCs

This commit is contained in:
taehoon 2019-02-13 23:25:21 -05:00
parent 339373b495
commit 6d4d705c51
4 changed files with 20 additions and 9 deletions

View file

@ -4,7 +4,10 @@ import map from 'lodash/map'
const defaultEntryPropsGetter = entry => ({ entry })
const defaultKeyGetter = entry => entry.id
const withList = ({ getEntryProps = defaultEntryPropsGetter, getKey = defaultKeyGetter }) => (ItemComponent) => (
const withList = ({
getEntryProps = defaultEntryPropsGetter, // function to accept entry and index values and return props to be passed into the item component
getKey = defaultKeyGetter // funciton to accept entry and index values and return key prop value
}) => (ItemComponent) => (
Vue.component('withList', {
render (createElement) {
return (