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
WARNING: Only use this with observables you know will complete. If the source observable does not complete, you will end up with a promise that is hung up, and potentially all of the state of an async function hanging out in memory.
The use of the word complete is causing me some confusion. I don't know if it means complete in the specific meaning of complete when talking about observations: emitted complete, didn't emit error. Or if it means completed in the general sense: The observation is finished - it either emitted complete, error, or otherwise "closed".
In my specific case, we want to await lastValueFrom an http get observation. We know the http get will either emit a complete, or an error. If it emits an error, and if by definition, it does not complete, then didn't we trigger the problem described in the warning? Or is complete including the error case in this scenario?
If it's the latter, should the documentation updated to be less ambiguous?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
lastValueFrom documentation states:
WARNING: Only use this with observables you know will complete. If the source observable does not complete, you will end up with a promise that is hung up, and potentially all of the state of an async function hanging out in memory.
The use of the word complete is causing me some confusion. I don't know if it means complete in the specific meaning of complete when talking about observations: emitted complete, didn't emit error. Or if it means completed in the general sense: The observation is finished - it either emitted complete, error, or otherwise "closed".
In my specific case, we want to await lastValueFrom an http get observation. We know the http get will either emit a complete, or an error. If it emits an error, and if by definition, it does not complete, then didn't we trigger the problem described in the warning? Or is complete including the error case in this scenario?
If it's the latter, should the documentation updated to be less ambiguous?
Beta Was this translation helpful? Give feedback.
All reactions