diff options
Diffstat (limited to 'src/scripts/controllers/connection')
| -rw-r--r-- | src/scripts/controllers/connection/cache.ts | 2 | ||||
| -rw-r--r-- | src/scripts/controllers/connection/socket.ts | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/scripts/controllers/connection/cache.ts b/src/scripts/controllers/connection/cache.ts index 15517519..c1c47c2d 100644 --- a/src/scripts/controllers/connection/cache.ts +++ b/src/scripts/controllers/connection/cache.ts @@ -62,7 +62,7 @@ export class CacheController { } public onFetch(request: IRequest, response: IResponse): any { - let pathWithoutVersion = request.path.replace(/\/v\d+/, ""); + const pathWithoutVersion = request.path.replace(/\/v\d+/, ""); this.routeCaches[pathWithoutVersion][request.parameters.path["id"]].status = CacheStatus.HIT; this.routeCaches[pathWithoutVersion][request.parameters.path["id"]].object = response.content; diff --git a/src/scripts/controllers/connection/socket.ts b/src/scripts/controllers/connection/socket.ts index b38c303f..c23495f1 100644 --- a/src/scripts/controllers/connection/socket.ts +++ b/src/scripts/controllers/connection/socket.ts @@ -19,7 +19,7 @@ export class SocketController { this._socket.on('connect', onConnect); this._socket.on('response', (jsonResponse: string) => { - let response: IResponse = JSON.parse(jsonResponse); + const response: IResponse = JSON.parse(jsonResponse); console.log("Response, ID:", response.id, response); this.callbacks[response.id](response); delete this.callbacks[response.id]; @@ -34,7 +34,7 @@ export class SocketController { */ public sendRequest(request: IRequest, callback: (response: IResponse) => any): void { // Check local cache, in case request is for cachable GET route - let cacheStatus = this._cacheController.checkCache(request); + const cacheStatus = this._cacheController.checkCache(request); if (cacheStatus === CacheStatus.HIT) { callback({ @@ -73,4 +73,4 @@ export class SocketController { SocketController.id++; } } -}
\ No newline at end of file +} |
