<script>
const obj = {};
let options = [
{ name: 'a' },
{ name: 'b' },
{ name: 'c' },
{ name: 'd' },
{ name: 'e' }
];
let a = options[0];
let b = options[1];
let a_changes = 0;
let b_changes = 0;
// if these two lines go at the bottom, things
// work correctly
$: obj.a = a;
$: obj.b = b;
$: (a, a_changes++);
$: (b, b_changes++);
</script>
<p>Changing one of these values should only increment one of the counters</p>
<select bind:value={a}>
{#each options as option}
<option value={option}>{option.name}</option>
{/each}
</select>
<select bind:value={b}>
{#each options as option}