【发布时间】:2020-11-16 23:32:39
【问题描述】:
我需要进行 API 调用。 我需要从我的效果内的商店中获取一些数据。 已经尝试使用 withLatestForm 但据我了解,您只能在开始时使用它。帮助将不胜感激。
sendTestStop = createEffect(() => {
return this.actions$.pipe(
ofType('[API] do it'),
switchMap(() => this.RestApiService.DoCommand()),
switchMap(
((value: TestStopResponse) => {
let response = [];
for (const test of value.ResponseArray) {
// here i need some data from the store <-------------------------
if(test.IsStopped){
response.push(this.viewActions.action({logString: "logmsg"}));
response.push(this.activeTestActions.action2({test: test}));
}
else{
response.push(this.viewActions.addLogEntry({logString: "logmsg"}));
}
}
return response;
})),
)
});
【问题讨论】:
标签: typescript rxjs ngrx