mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2026-01-10 17:34:24 +08:00
refactor: throw if el not found
This commit is contained in:
parent
cf1c93f551
commit
e9c4512fa6
1 changed files with 1 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ const skeletons = new Map<string, HTMLElement>();
|
|||
|
||||
export function save(id: string, removeAfter = true): void {
|
||||
const el = document.getElementById(id) as HTMLElement;
|
||||
if (!el) throw new Error(`Element with id ${id} not found`);
|
||||
skeletons.set(id, el);
|
||||
if (removeAfter) remove(id);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue