Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • the way you did it the finalValue would be the result of the timeout function not the original val. Commented Apr 22, 2021 at 10:26
  • @DavidB. I would assume OP is using that timeout as just a mock async method to simulate a promise, not necessary the real working one. Commented Apr 22, 2021 at 10:28
  • It's not necessary to use from within switchMap; you can simply return the promise. (I believe the xxxMap operators internally use from) Commented Apr 22, 2021 at 11:09