diff --git a/src/util/vue.tsx b/src/util/vue.tsx index 3220770..8b8bf09 100644 --- a/src/util/vue.tsx +++ b/src/util/vue.tsx @@ -12,7 +12,6 @@ import { onUnmounted, ref, shallowRef, - toRef, unref, watchEffect } from "vue"; @@ -38,10 +37,10 @@ export function coerceComponent( return component; } -export type VueFeature = { +export interface VueFeature { [ComponentKey]: GenericComponent; [GatherProps]: () => Record; -}; +} export function render(object: VueFeature | CoercableComponent): JSX.Element | DefineComponent { if (isCoercableComponent(object)) { @@ -86,6 +85,16 @@ export function renderColJSX(...objects: (VueFeature | CoercableComponent)[]): J return {objects.map(renderJSX)}; } +export function joinJSX(objects: JSX.Element[], joiner: JSX.Element): JSX.Element { + return objects.reduce((acc, curr) => ( + <> + {acc} + {joiner} + {curr} + + )); +} + export function isCoercableComponent(component: unknown): component is CoercableComponent { if (typeof component === "string") { return true;