Skip to content

Commit 993188c

Browse files
committed
remove this return type for consistency
correct return type is inferred automatically
1 parent af7cd8b commit 993188c

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export class Component<T extends HTMLElement = HTMLElement> extends ElementCompo
4141
return new Component<T>(document.createRange().createContextualFragment(html).children[0] as T);
4242
}
4343

44-
public override on<K extends keyof HTMLElementEventMap>(type: K, listener: (ev: HTMLElementEventMap[K], component: this) => any, options?: boolean | AddEventListenerOptions): this {
44+
public override on<K extends keyof HTMLElementEventMap>(type: K, listener: (ev: HTMLElementEventMap[K], component: this) => any, options?: boolean | AddEventListenerOptions) {
4545
return super.on(type as any, listener, options);
4646
}
4747
}

src/ElementComponent.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ export abstract class ElementComponent<T extends Element> {
153153
* @param listener
154154
* @param options
155155
*/
156-
public on<K extends keyof ElementEventMap>(type: K, listener: (ev: ElementEventMap[K], component: this) => any, options?: boolean | AddEventListenerOptions): this {
156+
public on<K extends keyof ElementEventMap>(type: K, listener: (ev: ElementEventMap[K], component: this) => any, options?: boolean | AddEventListenerOptions) {
157157
this.element.addEventListener(type, e => listener(e, this), options);
158158
return this;
159159
}

0 commit comments

Comments
 (0)