From 9fe855c77151fe230b04c59cc5f8ceca731581e3 Mon Sep 17 00:00:00 2001 From: takker99 <37929109+takker99@users.noreply.github.com> Date: Thu, 23 Mar 2023 11:31:10 +0900 Subject: [PATCH] :+1: Use a derived class at listener arguments --- baseStore.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/baseStore.ts b/baseStore.ts index 05c341e..9fc2110 100644 --- a/baseStore.ts +++ b/baseStore.ts @@ -1,12 +1,17 @@ -export type BaseStoreListenerInit = { store: BaseStore; event: string }; -export type BaseStoreListener = (init: BaseStoreListenerInit) => void; +export type BaseStoreListenerInit = { + store: Derived; + event: string; +}; +export type BaseStoreListener = ( + init: BaseStoreListenerInit, +) => void; export declare class BaseStore { constructor(); - public addChangeListener(listener: BaseStoreListener): void; - public removeChangeListener(listener: BaseStoreListener): void; + public addChangeListener(listener: BaseStoreListener): void; + public removeChangeListener(listener: BaseStoreListener): void; public emitChange(event: string): void; public get listenersCount(): number; - private _onChangeListeners: BaseStoreListener[]; + private _onChangeListeners: BaseStoreListener[]; }