YK
getHistory<T>(dataSource$: Observable<T>): Observable<T[]> {
return dataSource$.pipe(
scan((acc: T[], curr: T) => {
const res = acc.concat(curr);
if (res.length > 5) {
res.shift();
}
return res;
}, [])
);
}


