function combineValuesByTitleReducer(combiner) {
  return (acc, ds) => {
    const existingIndex = acc.findIndex(e => e.title === ds.title)
    // not found
    if (existingIndex === -1) {
      return acc.concat(ds)
    }

    // found in array, clone array but replace dataset
    const newArray = acc.slice()
    const newData = [].concat(acc[existingIndex].data, ds.data)
      .reduce(combineValuesAtTimestampReducer(combiner), [])

    newArray[existingIndex] = {
      ...acc[existingIndex],
      data: newData
    }
    return newArray
  }
}
Given an array of [ { title, keylabel, data: { ts, value } } ],
and having duplicated title lines, combine each of the datapoints,
applying combiner to the data values such that there will only be unique 'title' lines