$api?. => $api. when possible

Now that this stuff has all been cleaned up with useXContext functions
This commit is contained in:
Ryan Gossiaux
2021-12-18 23:56:37 -08:00
parent 70910c05b0
commit 305dc1543f
13 changed files with 50 additions and 50 deletions

View File

@@ -10,11 +10,11 @@
const id = `headlessui-menu-item-${useId()}`;
$: active =
$api?.activeItemIndex !== null
? $api?.items[$api?.activeItemIndex].id === id
$api.activeItemIndex !== null
? $api.items[$api.activeItemIndex].id === id
: false;
$: buttonStore = $api?.buttonStore;
$: buttonStore = $api.buttonStore;
let elementRef: HTMLDivElement | undefined;
$: textValue = elementRef?.textContent?.toLowerCase().trim();
@@ -22,7 +22,7 @@
onMount(async () => {
await tick();
$api?.registerItem(id, data);
$api.registerItem(id, data);
});
onDestroy(() => {