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'); this._requestStatus.next('error');
return EMPTY; return EMPTY;
}), }),
filter(Boolean),
tap(() => this._isLoading$.next(false)),
tap(() => this._requestStatus.next('success')), tap(() => this._requestStatus.next('success')),
shareReplay<any>({ bufferSize: 1, refCount: true }), finalize(() => {
finalize(() => this._requestStatus.next('idle')), this._isLoading$.next(false);
takeUntil(this.destroy$), this._requestStatus.next('idle');
}),
), ),
), ),
filter(Boolean),
shareReplay<any>({ bufferSize: 1, refCount: true }),
takeUntil(this.destroy$),
); );
} }

Loading…
Cancel
Save