ReactiveSet

ReactiveSet

<Story knobs={{ firstItem: 'bar' }} let:knobs={{ firstItem }}> <ReactiveSet input={[firstItem, ...books]} let:update let:value let:remove let:add let:size>

{JSON.stringify(value, null, 1)}
Size: {size}
<Button onclick={() => { const string = prompt('What would you like to add?'); if (string) { add(string.trim()); } }}>Add <Button onclick={() => update(['foo', 'fi', 'fee'])}>Update <Button onclick={() => remove(value[0])}>Remove "{value[0]}"

Edit page in GitHub