AltJS(通量)和#x2B;Typescript:存储区中bindListeners处的操作引用无效

AltJS(通量)和#x2B;Typescript:存储区中bindListeners处的操作引用无效,typescript,flux,Typescript,Flux,我实现了一个与之完全相同的示例项目,但是我得到了未捕获的引用error:Invalid action reference传入。此错误在运行时在“我的存储”中引发: this.bindListeners({ handleRefreshComponentLibrary: ComponentLibraryActions.refreshComponentLibrary, handleComponentLibraryRefreshed: Co

我实现了一个与之完全相同的示例项目,但是我得到了
未捕获的引用error:Invalid action reference传入
。此错误在运行时在“我的存储”中引发:

        this.bindListeners({
            handleRefreshComponentLibrary: ComponentLibraryActions.refreshComponentLibrary,
            handleComponentLibraryRefreshed: ComponentLibraryActions.componentLibraryRefreshed,
            handleComponentLibraryRefreshFailed: ComponentLibraryActions.componentLibraryRefreshFailed
        });
我引用的操作如下所示:

interface Actions{
    refreshComponentLibrary():void;
    componentLibraryRefreshed(componentLibrary: MqtlComponent[]):void;
    componentLibraryRefreshFailed(errorMsg:string):void;
}

class ComponentLibraryActions extends AbstractActions implements Actions{

    constructor(){
        super(altInstance);
        this.generateActions(
            "refreshComponentLibrary",
            "componentLibraryRefreshed",
            "componentLibraryRefreshFailed"
        )
    }

    refreshComponentLibrary(){
        console.log("ACTION!!! Refresh comp library");
        this.dispatch();

        //Trigger async
        ComponentLibraryStore.fetchComponentsFromServer();

    }

    componentLibraryRefreshed(componentLibrary: MqtlComponent[]){
        console.log("Dispatch action: Library refreshed");
        this.dispatch(componentLibrary);
    }

    componentLibraryRefreshFailed(errorMsg: string){
        console.log("Dispatch action: Library refresh failed");
        this.dispatch(errorMsg);
    }
}

export = altInstance.createActio
在并没有这个的情况下尝试过。生成(…)也是,但并没有运气

我不确定我的操作在结构上是否与alt.d.ts定义的操作相同,但我的操作与教程中的操作完全相同(我认为这样做是正确的)


有什么想法吗?是否有其他方法可以将操作绑定到存储区?

我已经成功地使用了redux:@basarat好的,但Alt似乎关心Typescript(他们在项目中维护打字),这就是我想使用它的原因。不应该那么难吗?我已经成功地使用了redux:@basarat好的,但是Alt似乎关心Typescript(他们在项目中维护打字),这就是为什么我想使用它。不应该那么难吗?