Remove state from shared.js, move to cache.js.

This commit is contained in:
David Anson 2019-04-10 21:26:59 -07:00
parent 827e1acb56
commit f614f3e1ce
17 changed files with 124 additions and 98 deletions

24
lib/cache.js Normal file
View file

@ -0,0 +1,24 @@
// @ts-check
"use strict";
let lineMetadata = null;
module.exports.lineMetadata = (value) => {
if (value) {
lineMetadata = value;
}
return lineMetadata;
};
let flattenedLists = null;
module.exports.flattenedLists = (value) => {
if (value) {
flattenedLists = value;
}
return flattenedLists;
};
module.exports.clear = () => {
lineMetadata = null;
flattenedLists = null;
};