tests and documentation

This commit is contained in:
Art Lowel
2020-02-18 18:15:18 +01:00
parent 08dedb2dc3
commit bc00c000a6
19 changed files with 430 additions and 75 deletions

View File

@@ -80,9 +80,9 @@ export class RemoteDataBuildService {
}
}),
hasValueOperator(),
map((obj: T) => {
return this.build<T>(obj, ...linksToFollow);
}),
map((obj: T) =>
this.linkService.resolveLinks(obj, ...linksToFollow)
),
startWith(undefined),
distinctUntilChanged()
);
@@ -135,9 +135,9 @@ export class RemoteDataBuildService {
switchMap((resourceUUIDs: string[]) => {
return this.objectCache.getList(resourceUUIDs).pipe(
map((objs: T[]) => {
return objs.map((obj: T) => {
return this.build<T>(obj, ...linksToFollow);
});
return objs.map((obj: T) =>
this.linkService.resolveLinks(obj, ...linksToFollow)
);
}));
}),
startWith([]),
@@ -166,11 +166,6 @@ export class RemoteDataBuildService {
return this.toRemoteDataObservable(requestEntry$, payload$);
}
build<T extends CacheableObject>(model: T, ...linksToFollow: Array<FollowLinkConfig<T>>): T {
this.linkService.resolveLinks(model, ...linksToFollow);
return model;
}
aggregate<T>(input: Array<Observable<RemoteData<T>>>): Observable<RemoteData<T[]>> {
if (isEmpty(input)) {