'Angular 13, use mat-table sort and pagination with ReplaySubject as observable

I am trying to sort, filter and add pagination to the below stackblitz angular 13 mat-table examples.

Wanted to add https://stackblitz.com/run?file=src/app/table-overview-example.ts to below observable data source mat-table.

https://stackblitz.com/edit/angular-cwbbpv?file=src/app/table-dynamic-observable-data-example.ts

I did try with MatTableDataSource, was able to filter, but the problem is when I try to add new row or update, the view is not pulling the latest observable array.

I still wanted to use Observable as a data service and wanted to just use MatTableDataSource to add sort, filter and pagination functionality to my mat-table.

Any sample code suggestions or updating the stackbliz link would be of great help.

Tried different sources on here, still not able to get a working solution.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source