-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathglobal-cache.js
36 lines (34 loc) · 1.09 KB
/
global-cache.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
const values = {
nearestGames: null,
currentGames: null,
subscribedChannels: [],
game: {
currentLiveFeed: null,
currentGamePk: null,
isDoubleHeader: null,
lastReportedCompleteAtBatIndex: null,
lastReportedPlayDescription: null,
startReported: false,
reportedDescriptions: [],
homeTeamColor: null,
awayTeamColor: null,
finished: false,
lastSocketMessageTimestamp: null,
lastSocketMessageLength: null
}
};
function resetGameCache () {
values.game.currentLiveFeed = null;
values.game.currentGamePk = null;
values.game.isDoubleHeader = null;
values.game.lastReportedCompleteAtBatIndex = null;
values.game.lastReportedPlayDescription = null;
values.game.startReported = false;
values.game.reportedDescriptions = [];
values.game.homeTeamColor = null;
values.game.awayTeamColor = null;
values.game.finished = false;
values.game.lastSocketMessageTimestamp = null;
values.game.lastSocketMessageLength = null;
}
module.exports = { values, resetGameCache };