import merge from 'lodash/merge'

const dependencies = {}

export const registerDependencies = dep => merge(dependencies, dep)

export default dependencies

import { mergeWith, isArray } from 'lodash'

function mergeArrays(objValue, srcValue) {
  if (isArray(objValue) && isArray(srcValue)) {
    return objValue.concat(srcValue)
  }
}

const dependencies = {}

export const registerDependencies = dep => mergeWith(dependencies, dep, mergeArrays)

export default dependencies

Allow registerDependencies to merge with existing arrays