mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-23 01:32:55 +02:00
Remove dependents from cache when dependency updated
This commit is contained in:
@@ -3,12 +3,16 @@ import { ScriptUrl } from "../Script/ScriptUrl";
|
||||
const importCache: { [hash: string]: ScriptUrl[] } = {};
|
||||
|
||||
export class ImportCache {
|
||||
static get(hash: string): ScriptUrl[] {
|
||||
return importCache[hash];
|
||||
static get(hash: string): ScriptUrl[] | null {
|
||||
return importCache[hash] || null;
|
||||
}
|
||||
|
||||
static store(hash: string, value: ScriptUrl[]): void {
|
||||
if (importCache[hash]) return;
|
||||
importCache[hash] = value;
|
||||
}
|
||||
|
||||
static remove(hash: string): void {
|
||||
delete importCache[hash];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user