Ever want to load a svelte component in aframe as a component? No? Well I did it anyhow.
multiple: true,
schema: {
props: {
// pass props to svelte component
default: {},
},
// the svelte component
component: {},
// fn to run to gather props
gather: {
default() {
return this.data.props
},
},
},
FancyWidget.svelte
<script>
export let parent
</script>
Your parent is a {typeof parent}
Consumer of Fancy and Svelte
<script>
import { registerSvelte, registerGather } from "aframe-svelte"
import FancyWidget from './FancyWidget.svelte'
registerSvelte("FancyWidget", FancyWidget)
// Gather and return props after instantiating
registerGather("Parent", function() {
return {
parent: "foobar"
}
})
</script>
<a-mixin svelte="component: FancyWidget; gather: Parent" />
Used for instantiating remote entity mixins in goblin.life!