-
- Notifications
You must be signed in to change notification settings - Fork 4.6k
Open
Description
Describe the problem
I like bitmasked enums. They consume very little RAM and working with them is super fast. I often build a bunch of checkboxes that represent an option (bitmasked value).
Describe the proposed solution
Just to be able to do bind:group
using a number and bit values:
<script> // State let options = $state(0); // Or directly as a prop is more desirable: let { options = $bindable(0), } = $props(); </script> {#each [1, 2, 4, 8] as bit} <label> <input type="checkbox" value={bit} bind:group={options}>{bit} </label> {/each}
Svelte could detect my options
variable is a number and therefore assume that all values in the bound checkboxes will be numbers that are added or removed using bitwise operators.
Importance
nice to have
Metadata
Metadata
Assignees
Labels
No labels