Skip to content

Commit

Permalink
feat: fix selectResultvariant is not a function
Browse files Browse the repository at this point in the history
  • Loading branch information
annacv committed Mar 26, 2024
1 parent f7ae7c2 commit 4818bd8
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
</template>

<script lang="ts">
import { computed, defineComponent } from 'vue';
import { computed, defineComponent, Ref } from 'vue';
import { Result, ResultVariant } from '@empathyco/x-types';
import { NoElement } from '../no-element';
import {
Expand Down Expand Up @@ -86,9 +86,9 @@
* @public
* @returns The 'selectResultVariant' injection key.
*/
const selectResultVariant:
| ((variant: ResultVariant, level?: number) => void)
| undefined = () => useHybridInject(SELECT_RESULT_VARIANT_KEY as string);
const selectResultVariant = useHybridInject<
Ref<(variant: ResultVariant, level?: number) => void | undefined>
>(SELECT_RESULT_VARIANT_KEY as string);
/**
* The original result, used to retrieve the available variants for the level.
Expand Down Expand Up @@ -136,7 +136,7 @@
* @internal
*/
const selectVariant = (variant: ResultVariant): void => {
selectResultVariant(variant, props.level);
selectResultVariant!.value(variant, props.level);
};
/**
Expand Down

0 comments on commit 4818bd8

Please sign in to comment.