13 lines
366 B
TypeScript
13 lines
366 B
TypeScript
type DungeonRuntimeReset = () => void;
|
|
|
|
const resetHandlers = new Set<DungeonRuntimeReset>();
|
|
|
|
export function registerDungeonRuntimeReset(handler: DungeonRuntimeReset): () => void {
|
|
resetHandlers.add(handler);
|
|
return () => resetHandlers.delete(handler);
|
|
}
|
|
|
|
export function clearDungeonRuntimeCaches(): void {
|
|
for (const handler of resetHandlers) handler();
|
|
}
|