From 3d9507879beb77a8acb0144d472e63b875adea9b Mon Sep 17 00:00:00 2001 From: Ruben Verborgh Date: Mon, 7 Sep 2020 09:11:55 +0200 Subject: [PATCH] refactor: Make PassthroughStore generic --- src/storage/PassthroughStore.ts | 6 +++--- src/storage/PatchingStore.ts | 4 ++-- src/storage/RepresentationConvertingStore.ts | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/storage/PassthroughStore.ts b/src/storage/PassthroughStore.ts index 0c261a301..6bef3a45a 100644 --- a/src/storage/PassthroughStore.ts +++ b/src/storage/PassthroughStore.ts @@ -10,10 +10,10 @@ import { ResourceStore } from './ResourceStore'; * Can be extended by stores that do not want to override all functions * by implementing a decorator pattern. */ -export class PassthroughStore implements ResourceStore { - protected readonly source: ResourceStore; +export class PassthroughStore implements ResourceStore { + protected readonly source: T; - public constructor(source: ResourceStore) { + public constructor(source: T) { this.source = source; } diff --git a/src/storage/PatchingStore.ts b/src/storage/PatchingStore.ts index 0dd9e2eeb..a2987b64a 100644 --- a/src/storage/PatchingStore.ts +++ b/src/storage/PatchingStore.ts @@ -10,10 +10,10 @@ import { ResourceStore } from './ResourceStore'; * If the original store supports the {@link Patch}, behaviour will be identical, * otherwise the {@link PatchHandler} will be called instead. */ -export class PatchingStore extends PassthroughStore { +export class PatchingStore extends PassthroughStore { private readonly patcher: PatchHandler; - public constructor(source: ResourceStore, patcher: PatchHandler) { + public constructor(source: T, patcher: PatchHandler) { super(source); this.patcher = patcher; } diff --git a/src/storage/RepresentationConvertingStore.ts b/src/storage/RepresentationConvertingStore.ts index 203149fba..5d6cb87ad 100644 --- a/src/storage/RepresentationConvertingStore.ts +++ b/src/storage/RepresentationConvertingStore.ts @@ -16,10 +16,10 @@ import { ResourceStore } from './ResourceStore'; * Even if there is a match with the output from the store, * if there is a low weight for that type conversions might still be preferred. */ -export class RepresentationConvertingStore extends PassthroughStore { +export class RepresentationConvertingStore extends PassthroughStore { private readonly converter: RepresentationConverter; - public constructor(source: ResourceStore, converter: RepresentationConverter) { + public constructor(source: T, converter: RepresentationConverter) { super(source); this.converter = converter; }