What is the actual impact of putting void
before promise?
async function doAsyncStuff(){
...
}
function nonAsyncFunction(){
void doAsyncStuff();
}
I couldn't find any official documentation for this, but it must be doing something as it resolves no-floating-promises
TSLint error.
void
is an operator that accepts a value on the Right-Hand Side and evaluates as undefined
.
It resolves no-floating-promises because it does something (or rather, explicitly nothing) with the promise.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With