mirror of
https://github.com/brendan-ch/project-inter-server.git
synced 2026-04-17 16:00:32 +00:00
rename methods for clarity on method events
This commit is contained in:
@@ -25,7 +25,7 @@ export interface GetterRepository {
|
||||
* if ETA data is restored.
|
||||
* @param listener
|
||||
*/
|
||||
subscribeToEtaChanges(
|
||||
subscribeToEtaUpdates(
|
||||
listener: (eta: IEta) => void,
|
||||
): void;
|
||||
|
||||
@@ -34,7 +34,7 @@ export interface GetterRepository {
|
||||
* Callback must be passed by reference.
|
||||
* @param listener
|
||||
*/
|
||||
unsubscribeFromEtaChanges(listener: (eta: IEta) => void): void;
|
||||
unsubscribeFromEtaUpdates(listener: (eta: IEta) => void): void;
|
||||
|
||||
getOrderedStopByRouteAndStopId(routeId: string, stopId: string): Promise<IOrderedStop | null>;
|
||||
|
||||
|
||||
@@ -61,11 +61,11 @@ export class UnoptimizedInMemoryRepository implements GetterSetterRepository {
|
||||
return this.etas.filter(eta => eta.stopId === stopId);
|
||||
}
|
||||
|
||||
public subscribeToEtaChanges(listener: (eta: IEta) => void) {
|
||||
public subscribeToEtaUpdates(listener: (eta: IEta) => void) {
|
||||
this.subscribers.push(listener);
|
||||
}
|
||||
|
||||
public unsubscribeFromEtaChanges(listener: (eta: IEta) => void) {
|
||||
public unsubscribeFromEtaUpdates(listener: (eta: IEta) => void) {
|
||||
const index = this.subscribers.findIndex((existingListener) => existingListener == listener);
|
||||
if (index >= 0) {
|
||||
this.subscribers.splice(index, 1);
|
||||
|
||||
Reference in New Issue
Block a user