github.com/outbrain/consul@v1.4.5/ui-v2/app/utils/update-array-object.js (about)

     1  import { get, set } from '@ember/object';
     2  export default function(arr, item, prop, value) {
     3    value = typeof value === 'undefined' ? get(item, prop) : value;
     4    const current = arr.findBy(prop, value);
     5    if (current) {
     6      // TODO: This is reliant on changeset?
     7      Object.keys(get(item, 'data')).forEach(function(prop) {
     8        set(current, prop, get(item, prop));
     9      });
    10      return current;
    11    }
    12  }