Open
Description
if we invoke else service method suck as this.getActions()
inside the effectActions[actionName]
function in sync way, it will cause an error:
InternalError: "too much recursion"
the effect can be:
@Effect()
fetchInfo(url$: Observable<string>):Observable<EffectAction> {
return url$.pipe(
switchMap(url => from(client.get(url))),
mergeMap(data => of(this.getActions().setData(data), this.getActions().setLoading(false))),
startWith(this.getActions().setLoading(true)),
)
}
the effect init function is :
Line 196 in b7b644b
because the startWith
is sync, so this.getActions()
will request the ikari
instance, but the ikari instance is not fully constructed at that time. so it will invoke the create function again and agian...