fast
fast copied to clipboard
feat: add ability to return only one element from `SlottedBehavior`
🙋 Feature Request
Sometimes you want a component to only support one element in a given slot.
🤔 Expected Behavior
The ability to tell slotted to return just one element. Like Ref currently does.
😯 Current Behavior
Currently Slotted will always return an array, even when using a filter function.
After this change the return type of SlottedBehavior.getNodes would change to Node | NodeList
💁 Possible Solution
An additional configuration option to only return the first element that matches the filter.