You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think it is under-documented that, because @Effects are also Observables, they stop emitting values after erring or being completed.
I see waiting for something that never happens effectively as silently failing. As this happens more often when working with Observables, developers are used to it, but it could be expected that @Effects work differently.
It would be quite helpful to have a list of operators which are dangerous to use in @Effects, ie, operators that complete observables, such as first() and empty(), and using the catchError() operator in the 'main' Effect observable (as opposed to within switchMap, concatMap, map etc).
I suggest that either:
@Effects when they error ór complete, provide a warning regarding them being completed.
documentation is updated to reflect that developers have to be careful with certain operators (see list idea above) in @Effects.
The text was updated successfully, but these errors were encountered:
michahell
changed the title
Huge caveat with completing Effects which is not documented.
Somehow warn developers about erring or completing @Effect Observables
Oct 12, 2018
I think explaining the different (dangerous) operators inside the NgRx docs is not the right place. Perhaps we should add a catchError example and explicitly mention it, or add it to a "FAQ" section?
Yes, showing how to handle errors in an Effect would be a great start, or better said, how not to handle errors :)
I dont fully grok the safeCall operator yet, but it looks like the purpose is an operator with two end phases, either success or erring, which I think is the 99% use case indeed :)
I think it is under-documented that, because
@Effect
s are alsoObservable
s, they stop emitting values after erring or being completed.I see waiting for something that never happens effectively as silently failing. As this happens more often when working with Observables, developers are used to it, but it could be expected that
@Effect
s work differently.It would be quite helpful to have a list of operators which are dangerous to use in
@Effect
s, ie, operators that complete observables, such asfirst()
andempty()
, and using thecatchError()
operator in the 'main' Effect observable (as opposed to withinswitchMap
,concatMap
,map
etc).I suggest that either:
@Effect
s when they error ór complete, provide a warning regarding them being completed.@Effect
s.related SO posts:
The text was updated successfully, but these errors were encountered: