From ba7f877581c52dbcf10421f73ae1c139f81eb287 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sat, 16 Apr 2022 18:38:12 -0500 Subject: [PATCH] Made tab family's options function optional --- src/features/tabs/tabFamily.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/tabs/tabFamily.ts b/src/features/tabs/tabFamily.ts index a113f5c..316b131 100644 --- a/src/features/tabs/tabFamily.ts +++ b/src/features/tabs/tabFamily.ts @@ -92,7 +92,7 @@ export type GenericTabFamily = Replace< export function createTabFamily( tabs: Record TabButtonOptions>, - optionsFunc: OptionsFunc, BaseTabFamily> + optionsFunc?: OptionsFunc, BaseTabFamily> ): TabFamily { if (Object.keys(tabs).length === 0) { console.warn("Cannot create tab family with 0 tabs"); @@ -100,7 +100,7 @@ export function createTabFamily( } return createLazyProxy(persistent => { - const tabFamily = Object.assign(persistent, optionsFunc()); + const tabFamily = Object.assign(persistent, optionsFunc?.()); tabFamily.id = getUniqueID("tabFamily-"); tabFamily.type = TabFamilyType;