Skip to content

Commit

Permalink
fix(ui/element): listener list type
Browse files Browse the repository at this point in the history
  • Loading branch information
MM25Zamanian committed Dec 25, 2022
1 parent a305c5d commit e089d01
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/element/src/mixins/signal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import type {Constructor} from '../type.js';
import type {ListenerInterface} from '@alwatr/signal';

export declare class SignalMixinInterface extends LitElement {
protected _signalListenerList: Array<ListenerInterface<keyof AlwatrSignals>>;
protected _signalListenerList: Array<unknown>;
}

export function SignalMixin<ClassType extends Constructor<LitElement>>(
superClass: ClassType,
): Constructor<SignalMixinInterface> & ClassType {
class SignalMixinClass extends superClass {
protected _signalListenerList: Array<ListenerInterface<keyof AlwatrSignals>> = [];
protected _signalListenerList: Array<unknown> = [];

override disconnectedCallback(): void {
super.disconnectedCallback();

this._signalListenerList.forEach((listener) => listener.remove());
this._signalListenerList.forEach((listener) => (listener as ListenerInterface<keyof AlwatrSignals>).remove());
}
}

Expand Down

0 comments on commit e089d01

Please sign in to comment.