I am trying to remove the currently logged-in user using a filter method, but I encountered an error:
Type 'Subscription' is missing the following properties from type 'Observable[]>': _isScalar, source, operator, lift, and 6 more.
Below is the code snippet causing the issue:
@Select(UserPageState.get('collection')) users$: Observable<Array<Partial<User>>>;
async ngOnInit() {
const USER = this.creds.credentials['id'];
this.users$.subscribe(param => param.filter(x => x.id !== USER));
await this.store.dispatch(new UserPageList({ start: 1, length: this.pageSize })).toPromise();
}
HTML
<ag-grid-angular
style="width: 100%; height: 100%;"
[class]="(darkMode$ | async) ? 'ag-theme-balham-dark' : 'ag-theme-balham'"
[gridOptions]="gridOptions"
[rowData]="users$ | async"
[columnDefs]="columnDefs"
[frameworkComponents]="frameworkComponents"
(gridReady)="onGridReady($event)"
(firstDataRendered)="onFirstDataRendered($event)"
>
</ag-grid-angular>