Skip to content
Advertisement

Why is my function saying that a promise isn’t being handled correctly?

New to Typescript. Wrote this function but I can’t figure out why it’s giving the error below. I commented the 2 lines that the errors are pointing to.

JavaScript

48:9 error Promises must be handled appropriately or explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises

61:9 error Promises must be handled appropriately or explicitly marked as ignored with the void operator @typescript-eslint/no-floating-promises

Advertisement

Answer

You need to use then with set method to return promise. Like this

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement