function mergeContext (primary, secondary) {
    const merged = { ...primary }
    for (const prop in secondary) {
      if (hasOwnProperty(primary, prop)) {
        merged[prop] = { ...secondary[prop], ...primary[prop] }
      } else {
        merged[prop] = secondary[prop]
      }
    }
    return merged
  }
Merge the given contexts, with primary overriding secondary
wherever they might conflict