convert the given array to an object, use the `uid` field of each item as the key
@param {Array} itemArr
@returns an object
function convertToObject(itemArr) {
  var obj = {};
  _.each(itemArr, function(item) {
    obj[item.uid] = item;
  });
  return obj;
}