forked from AkkomaGang/akkoma-fe
Use native filter function
This commit is contained in:
parent
a6f2af4ad9
commit
651c97153b
2 changed files with 2 additions and 4 deletions
|
@ -1,5 +1,4 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import filter from 'lodash/filter'
|
|
||||||
import isEmpty from 'lodash/isEmpty'
|
import isEmpty from 'lodash/isEmpty'
|
||||||
import { getComponentProps } from '../../services/component_utils/component_utils'
|
import { getComponentProps } from '../../services/component_utils/component_utils'
|
||||||
import './with_load_more.scss'
|
import './with_load_more.scss'
|
||||||
|
@ -12,7 +11,7 @@ const withLoadMore = ({
|
||||||
additionalPropNames = [] // additional prop name list of the wrapper component
|
additionalPropNames = [] // additional prop name list of the wrapper component
|
||||||
}) => (WrappedComponent) => {
|
}) => (WrappedComponent) => {
|
||||||
const originalProps = Object.keys(getComponentProps(WrappedComponent))
|
const originalProps = Object.keys(getComponentProps(WrappedComponent))
|
||||||
const props = filter(originalProps, v => v !== childPropName).concat(additionalPropNames)
|
const props = originalProps.filter(v => v !== childPropName).concat(additionalPropNames)
|
||||||
|
|
||||||
return Vue.component('withLoadMore', {
|
return Vue.component('withLoadMore', {
|
||||||
render (createElement) {
|
render (createElement) {
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import filter from 'lodash/filter'
|
|
||||||
import isEmpty from 'lodash/isEmpty'
|
import isEmpty from 'lodash/isEmpty'
|
||||||
import { getComponentProps } from '../../services/component_utils/component_utils'
|
import { getComponentProps } from '../../services/component_utils/component_utils'
|
||||||
import './with_subscription.scss'
|
import './with_subscription.scss'
|
||||||
|
@ -11,7 +10,7 @@ const withSubscription = ({
|
||||||
additionalPropNames = [] // additional prop name list of the wrapper component
|
additionalPropNames = [] // additional prop name list of the wrapper component
|
||||||
}) => (WrappedComponent) => {
|
}) => (WrappedComponent) => {
|
||||||
const originalProps = Object.keys(getComponentProps(WrappedComponent))
|
const originalProps = Object.keys(getComponentProps(WrappedComponent))
|
||||||
const props = filter(originalProps, v => v !== childPropName).concat(additionalPropNames)
|
const props = originalProps.filter(v => v !== childPropName).concat(additionalPropNames)
|
||||||
|
|
||||||
return Vue.component('withSubscription', {
|
return Vue.component('withSubscription', {
|
||||||
props: [
|
props: [
|
||||||
|
|
Loading…
Reference in a new issue