IJSRuntime.InvokeVoidAsync() called as last thing in a code path causes CA2012 (Use ValueTasks correctly) warning. Can it be safely ignored, or should I fix that with awaiting it?
When I add .Preserve() at the end of my synchronous call the warning disappears, the code works the same. Why is that? What happens? What does this method do? The documentation (of Preserve() method) is unclear.
I want "fire and forget" use of a method that returns a ValueTask. What is the most correct way to achieve that, calling it from a synchronous method?
To add some context - I execute JS from my Blazor code. I do not rely on effects caused by the JS code after calling it. That's why I do not await it. I can refactor my code to await the ValueTask but would it serve any other purpose than making the Code Analyzer happy?