93803: Update DataService constructor signatures

Override linkPath/responseMsToLive/constructIdEndpoint
  - in class body for inheritable classes (for clarity: it's the first thing you'd read, variable name is right there)
  - in constructor for composable classes
    * wrapped services must be 'synchronized' with their wrapper
    * moved these overrides up in the argument list for emphasis (implementing a new composable feature? first thing is to use the same endpoint!)
This commit is contained in:
Yura Bondarenko
2022-09-05 10:55:58 +02:00
parent 38203490c7
commit a6fb4a6303
70 changed files with 294 additions and 184 deletions

View File

@@ -65,15 +65,15 @@ export interface PatchData<T extends CacheableObject> {
export class PatchDataImpl<T extends CacheableObject> extends IdentifiableDataService<T> implements PatchData<T> {
constructor(
protected linkPath: string,
protected responseMsToLive: number,
protected constructIdEndpoint: ConstructIdEndpoint,
protected requestService: RequestService,
protected rdbService: RemoteDataBuildService,
protected objectCache: ObjectCacheService,
protected halService: HALEndpointService,
protected comparator: ChangeAnalyzer<T>,
protected responseMsToLive: number,
protected constructIdEndpoint: ConstructIdEndpoint,
) {
super(linkPath, requestService, rdbService, objectCache, halService, responseMsToLive, constructIdEndpoint);
super(requestService, rdbService, objectCache, halService);
if (hasNoValue(constructIdEndpoint)) {
throw new Error(`PatchDataImpl initialized without a constructIdEndpoint method (linkPath: ${linkPath})`);
}