InvokeAsync

Learn how to use asynchronous methods with return values to call JavaScript in Blazor WebAssembly.

We'll cover the following...

The InvokeAsync method is used when we want to call a JavaScript function that returns a value. It invokes the specified JavaScript function asynchronously.

This is the InvokeAsync method of IJSRuntime:

Press + to interact
ValueTask<TValue> InvokeAsync<TValue>(string identifier, params object[] args);
...