private void Search(string term, int page) { Action <string> action = async(token) => { BooksClient.Token = token; Books = await BooksClient.SearchBooks(term, page); StateHasChanged(); }; ((MonoWebAssemblyJSRuntime)JSRuntime).InvokeUnmarshalled <Action <string>, bool>("blazorDemoInterop.executeWithToken", action); }
private async Task Search(string term, int page) { Action <string> action = async(token) => { BooksClient.Token = token; Books = await BooksClient.SearchBooks(term, page); StateHasChanged(); }; await JSRuntime.Current.InvokeAsync <bool>("blazorDemoInterop.executeWithToken", action); }