Skip to content

Commit 71e754f

Browse files
Kaizefir-git
andauthored
Shorten it into a single line
Co-authored-by: Zefir <[email protected]>
1 parent 83d71b3 commit 71e754f

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Component.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,7 @@ export class Component<T extends HTMLElement = HTMLElement> extends BaseComponen
6363
* @param selector A group of selectors
6464
*/
6565
public selectAll<T extends HTMLElement>(selector: string): Component<T>[] {
66-
const elements = [...this.element.querySelectorAll<T>(selector)];
67-
return elements.map(e => new Component<T>(e));
66+
return [...this.element.querySelectorAll<T>(selector)].map(e => new Component<T>(e));
6867
}
6968

7069
public override on<K extends keyof HTMLElementEventMap>(type: K, listener: (ev: HTMLElementEventMap[K], component: this) => any, options?: boolean | AddEventListenerOptions) {

0 commit comments

Comments
 (0)