Files
windmill/frontend/src/lib/components/apps/editor/contextPanel/ComponentOutputViewer.svelte
T
2022-11-23 14:45:56 +01:00

23 lines
582 B
Svelte

<script lang="ts">
import ObjectViewer from '$lib/components/propertyPicker/ObjectViewer.svelte'
import { getContext } from 'svelte'
import type { AppEditorContext } from '../../types'
export let outputs: string[] = []
export let componentId: string
const { worldStore } = getContext<AppEditorContext>('AppEditorContext')
let object = {}
outputs.forEach((output: string) => {
$worldStore?.outputsById[componentId][output].subscribe({
next: (value) => {
object[output] = value
}
})
})
</script>
<ObjectViewer json={object} on:select topBrackets={true} />