diff --git a/client/shared/manager/buildReg.ts b/client/shared/manager/buildReg.ts index 01eaaba6ba7..c00c6c535e2 100644 --- a/client/shared/manager/buildReg.ts +++ b/client/shared/manager/buildReg.ts @@ -9,7 +9,7 @@ export function buildRegFn any>( name: string, defaultFunc?: F ) { - let func: F; + let func: F | undefined; const get = (...args: Parameters): ReturnType => { if (!func) { @@ -26,7 +26,11 @@ export function buildRegFn any>( func = fn; }; - return [get, set] as const; + const reset = (): void => { + func = defaultFunc; + }; + + return [get, set, reset] as const; } /**