如何在Angular组件中模拟ngrx动作?

问题描述 投票:0回答:1

//初始化函数的组件代码

this.rootStore.dispatch(new action1());

在效果上,我称之为'action1Success'

我有用于action1Success的管道,并在组件中订阅了功能

//组件代码

this.actionListener$.pipe( ofType(  MyactionTypes.action1Success)).subscribe((success: SuccessObj) => { });
angular unit-testing karma-runner ngrx effects
1个回答
0
投票
provideMockActions
© www.soinside.com 2019 - 2024. All rights reserved.