Suppose I have a list of items with Svelte stores as members, e.g.:
interface Item { isAvailable: Writable<boolean>;}
If I have some component with a boolean
prop, how do I pass values from those stores to that prop if I'm iterating over the items?
I would have thought there'd be some straightforward syntax resembling this:
{#each items as item}<Component isEnabled={item.$isAvailable} />{/each}
The best solution I can think of would be defining another component something like:
<script> export let item: Item; $: isAvailable = item.isAvailable;</script><Component isEnabled={$isAvailable} />
But that seems like an excessive amount of boilerplate.