|
|
|
|
|
by TheCycoONE
2536 days ago
|
|
If you need you can name your intermediate results fooPromise or something else to make it obvious that it isn't meant to be used directly. The async article linked from this article has a toy example for this concept where the result is unused, but most of the time you would be passing the result somewhere. If you were using typescript it could fail at compile time when you try to pass a promise instead of the expected type. Even if you're not, you should notice it never work in your tests. |
|
Still, I think it is easiest to never mess up if you await as soon as you have a promise value. In many common cases this is easy enough.