add cache initialization

This commit is contained in:
2025-01-07 14:46:24 -08:00
parent 32bbbf6fdf
commit f6e62cc5e2

View File

@@ -14,6 +14,19 @@ interface ApiBasedRepositoryCache {
} }
export class ApiBasedRepository implements GetterRepository { export class ApiBasedRepository implements GetterRepository {
private cache: ApiBasedRepositoryCache;
constructor(initialCache: ApiBasedRepositoryCache | undefined = undefined) {
if (initialCache) {
this.cache = initialCache;
} else {
this.cache = {
etasForShuttleId: {},
etasForStopId: {},
}
}
}
public async getEtaForShuttleAndStopId(shuttleId: string, stopId: string): Promise<IEta | null> { public async getEtaForShuttleAndStopId(shuttleId: string, stopId: string): Promise<IEta | null> {
return null; return null;
} }