Skip to content

Commit

Permalink
set loading state to true every list request
Browse files Browse the repository at this point in the history
  • Loading branch information
muhammedaltug committed Jun 10, 2022
1 parent 5cbe436 commit 1cedd4a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions npm/ng-packs/packages/core/src/lib/services/list.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,8 @@ export class ListService<QueryParamsType = ABP.PageQueryParams | any> implements
hookToQuery<T>(
streamCreatorCallback: QueryStreamCreatorCallback<T, QueryParamsType>,
): Observable<PagedResultDto<T>> {
this._isLoading$.next(true);

return this.query$.pipe(
tap(() => this._isLoading$.next(true)),
switchMap(query => streamCreatorCallback(query).pipe(catchError(() => of(null)))),
filter(Boolean),
tap(() => this._isLoading$.next(false)),
Expand Down

0 comments on commit 1cedd4a

Please sign in to comment.