1
0

64961: server-sync-buffer bugfix, data-service update revert changes + edit-bitstream onSubmit refactoring

This commit is contained in:
Kristof De Langhe
2019-09-20 15:24:24 +02:00
parent 4357c19cad
commit f152cad1fa
4 changed files with 55 additions and 34 deletions

View File

@@ -126,3 +126,15 @@ export const getFirstOccurrence = () =>
source.pipe(
map((rd) => Object.assign(rd, { payload: rd.payload.page.length > 0 ? rd.payload.page[0] : undefined }))
);
/**
* Get the first succeeded RemoteData's payload
*/
export const getFirstSucceededRemoteDataPayload = () =>
<T>(source: Observable<RemoteData<T>>): Observable<T> =>
source.pipe(
getSucceededRemoteData(),
getRemoteDataPayload(),
hasValueOperator(),
take(1)
);