Basic usage

Given two arrays of items and an identity function, returns the first list with all items from the second list where there was a match.

import { merge } from 'radash'

const gods = [{
  name: 'Zeus',
  power: 92,
}, {
  name: 'Ra',
  power: 97,
}]

const newGods = [{
  name: 'Zeus',
  power: 100,
}]

merge(gods, newGods, f => f.name) // => [{name: "Zeus" power: 100}, {name: "Ra", power: 97}]

Testing

This _.merge function is 100% covered by tests. See them and contribute at GitHub.

Source

See the source for _.merge on GitHub.