Skip to content

Commit

Permalink
fix(akita-mat-data-source): Fix subscription
Browse files Browse the repository at this point in the history
  • Loading branch information
manudss committed Nov 24, 2020
1 parent 2c9830c commit 3772660
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions projects/akita-mat-datasource/src/lib/akita-mat-data-source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {DataSource} from '@angular/cdk/table';
import {BehaviorSubject, combineLatest, merge, Observable, Subject, Subscription} from 'rxjs';
import {EntityState, getEntityType, HashMap, ID, Order, QueryEntity} from '@datorama/akita';

import {debounceTime, map, takeUntil} from 'rxjs/operators';
import {debounceTime, map, takeUntil, tap} from 'rxjs/operators';
import {MatSort, Sort} from '@angular/material/sort';
import {MatPaginator, PageEvent} from '@angular/material/paginator';
// @ts-ignore
Expand Down Expand Up @@ -368,13 +368,13 @@ export class AkitaMatDataSource<S extends EntityState = any, E = getEntityType<S
} else {
subscription = this._selectAllByFilter$;
}
subscription.pipe(
takeUntil(this._disconnect),
debounceTime(this._dataSourceOptions.debounceTimeBetweenTwoChanges)
);
// Watched for paged data changes and send the result to the table to render.
this._renderChangesSubscription.unsubscribe();
this._renderChangesSubscription = subscription.pipe(
takeUntil(this._disconnect),
debounceTime(this._dataSourceOptions.debounceTimeBetweenToChanges)
)
.subscribe(data => this._renderData.next(data));
this._renderChangesSubscription = subscription.subscribe(data => this._renderData.next(data));

this._internalPageChanges.next();
}
Expand Down

0 comments on commit 3772660

Please sign in to comment.