From 32bbbf6fdfd04ff10742cafeb09c6f070c7848a4 Mon Sep 17 00:00:00 2001 From: Brendan Chen Date: Tue, 7 Jan 2025 14:44:37 -0800 Subject: [PATCH] add caching intreface --- src/repositories/ApiBasedRepository.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/repositories/ApiBasedRepository.ts b/src/repositories/ApiBasedRepository.ts index 00b1353..4c9a1c0 100644 --- a/src/repositories/ApiBasedRepository.ts +++ b/src/repositories/ApiBasedRepository.ts @@ -1,8 +1,18 @@ import { GetterRepository } from "./GetterRepository"; -import { IEta } from "../entities/entities"; +import { IEta, IOrderedStop, IRoute } from "../entities/entities"; // TODO: implement +interface ApiBasedRepositoryCache { + etasForShuttleId: { + [shuttleId: string]: IEta[], + }, + etasForStopId: { + [stopId: string]: IEta[], + }, + // To speed things up, implement caches for other data later +} + export class ApiBasedRepository implements GetterRepository { public async getEtaForShuttleAndStopId(shuttleId: string, stopId: string): Promise { return null;