Browse Source

update: deal with request status changes inside the stream callback

pull/20804/head
sumeyyeKurtulus 2 years ago
parent
commit
e5b4451c5d
  1. 12
      npm/ng-packs/packages/core/src/lib/services/list.service.ts

12
npm/ng-packs/packages/core/src/lib/services/list.service.ts

@ -137,14 +137,16 @@ export class ListService<QueryParamsType = ABP.PageQueryParams | any> implements
this._requestStatus.next('error');
return EMPTY;
}),
filter(Boolean),
tap(() => this._isLoading$.next(false)),
tap(() => this._requestStatus.next('success')),
shareReplay<any>({ bufferSize: 1, refCount: true }),
finalize(() => this._requestStatus.next('idle')),
takeUntil(this.destroy$),
finalize(() => {
this._isLoading$.next(false);
this._requestStatus.next('idle');
}),
),
),
filter(Boolean),
shareReplay<any>({ bufferSize: 1, refCount: true }),
takeUntil(this.destroy$),
);
}

Loading…
Cancel
Save