export default function feature(existing, id, options = {}) {
  if(!id) {
    return existing
  } 

  if(typeof options === 'string') {
    options = {id: options}  
  } 

  if (typeof options === 'function') {
    options = options.call(this, existing, id)
  }

  return {
    ...existing || {},
    [id]: options,
  }
}
