Closed zefir-git closed 6 days ago
The changes in the pull request focus on the NodeComponent
class located in src/NodeComponent.ts
. A new method named slot
has been introduced, which enables the component to render itself in place of a specified <slot>
element. This method takes two parameters: slot
, a string indicating the name of the slot, and an optional parent
, which defaults to document
and defines the parent element for slot searching. The method employs querySelectorAll
to locate all <slot>
elements by the given name and replaces them with the component's node.
Additionally, the on
method has been updated to support overloads, allowing for various combinations of parameters for event listener registration. The new signatures include options for an options object and a boolean for the useCapture
parameter. These modifications collectively enhance the capabilities of the NodeComponent
class by facilitating slot rendering and providing more flexible event listener management.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Example usage: