diff options
| author | taehoon <th.dev91@gmail.com> | 2019-02-25 02:10:59 -0500 |
|---|---|---|
| committer | taehoon <th.dev91@gmail.com> | 2019-02-28 12:40:22 -0500 |
| commit | 3a689ef8eead0503b90d3c9dec3b15fa0ace8eb6 (patch) | |
| tree | 89fe4097c7f9270d6991a4971e91d0bd9e3cbcef /src/hocs/with_load_more | |
| parent | dc01f90dde55e2babf58878177308c11aa965006 (diff) | |
Allow HOCs to accept additional props
Diffstat (limited to 'src/hocs/with_load_more')
| -rw-r--r-- | src/hocs/with_load_more/with_load_more.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hocs/with_load_more/with_load_more.js b/src/hocs/with_load_more/with_load_more.js index e862a39b..a521014c 100644 --- a/src/hocs/with_load_more/with_load_more.js +++ b/src/hocs/with_load_more/with_load_more.js @@ -6,10 +6,11 @@ import './with_load_more.scss' const withLoadMore = ({ fetch, // function to fetch entries and return a promise select, // function to select data from store - childPropName = 'entries' // name of the prop to be passed into the wrapped component + childPropName = 'entries', // name of the prop to be passed into the wrapped component + additionalPropNames = [] // additional prop name list of the wrapper component }) => (WrappedComponent) => { const originalProps = WrappedComponent.props || [] - const props = filter(originalProps, v => v !== 'entries') + const props = filter(originalProps, v => v !== childPropName).concat(additionalPropNames) return Vue.component('withLoadMore', { render (createElement) { |
