There are two ways to do it because Angular Material is inconsistent, and this is very poorly documented. Angular material table won't update when a new row will arrive. Surprisingly it is told it is because performance issues. But it looks more like a by design issue, they can not change. It should be expected for the table to update when new row occurs. If this behavior should not be enabled by default there should be a switch to switch it off.
Anyways, we can not change Angular Material. But we can basically use a very poorly documented method to do it:
One - if you use an array directly as a source:
call table.renderRows()
where table is ViewChild of the mat-table
Second - if you use sorting and other features
table.renderRows() surprisingly won't work. Because mat-table is inconsistent here. You need to use a hack to tell the source changed. You do it with this method:
this.dataSource.data = yourDataSource;
where dataSource is MatTableDataSource wrapper used for sorting and other features.