Re:Ruby Methods Are Colorless
by akoboldfrying on Tuesday July 23, 2024 @09:47PM
(#41052899)
It's a big neon sign that says "Either this function is expensive, or it isn't but some framework somewhere that sometimes needs to call expensive functions might also need to call this function using the same syntax".
[ Parent
| on HN ]
This feels very true in Rust but not sure about JS. In JS you can `await` non-promise values without issue.
No, because in JavaScript/TypeScript you can happily await any function that you'd like on the chance that it sometimes returns a Promise. If a framework demands that you return a Promise unnecessarily, that's on the framework, not the language.