function deDuplicateHistory(history) {
    const deDuplicatedHistory = history.reduce((a,c) => {
        if(a.has(c.id)) {
            return a
        }
        a.set(c.id, c)
        return a
    }, new Map())

    return Array.from(deDuplicatedHistory).map(([key, value]) => value)
}
@param {{id: string}[]} history 
@returns {{id: string}[]}