@effect()
public loadAccommodations$: Observable = this.actions$
.ofType(PAA.PROPERTY_LOAD_REQUEST)
// .debounce(300)
// introducing this mitigates the flood but does not resolve the issue
.switchMap((action: Action) => {
return this.propertyAccommodationsService.loadAccommodations(action.payload.id)
.takeUntil(this.loadAccommodations$)
.map((response: IResponseSuccess) => PAA.loadSuccess(action.payload, response))
.catch((error: Error) => {
const errorNotification = errorNotificationFactory(error.message);
this.notificationService(errorNotification)
return of(PAA.loadFailure());
});
});
调度PAA.PROPERTY_LOAD_REQUEST只有一次我的影响拦截此动作多次,直到超过最大调用堆栈大小后。单动调度结果exceded
版本: “角/芯”: “2.4.6”,
“@ NGRX /芯”: “^ 1.2.0”,
“@ NGRX /存储”:“^ 2.2.1" ,
“@ NGRX /效应”: “^ 2.0.1”,
“rxjs”: “5.0.2”,
注:作用在应用程序注册只有一次.module。
谢谢大卫,我更新了这个问题。我没有派遣相同的动作(loadRequest),而是两种不同的动作之一(loadSuccess或loadFailure)。 – Sasha
现在它是否工作?还是有另一个问题?你如何派遣你的行动? – David
不,它不起作用,因为我说我的效果会返回一个与触发器动作完全无关的动作。 – Sasha