Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify return type #536

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@

<ItemGroup>
<PackageReference Include="Microsoft.Maui.Controls" Version="$(MauiVersion)" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0-rc.1.24431.7" />
<PackageReference Include="Microsoft.Extensions.Logging.Debug" Version="9.0.0-rc.2.24473.5" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ private async void OnInvokeJSMethodButtonClicked(object sender, EventArgs e)
double x = 123d;
double y = 321d;

var result = await hybridWebView.InvokeJavaScriptAsync<ComputationResult>(
ComputationResult result = await hybridWebView.InvokeJavaScriptAsync<ComputationResult>(
"AddNumbers", // JavaScript method name
HybridSampleJSContext.Default.ComputationResult, // JSON serialization info for return type
[x, y], // Parameter values
Expand All @@ -40,7 +40,7 @@ private async void OnInvokeAsyncJSMethodButtonClicked(object sender, EventArgs e
{
string statusResult = string.Empty;

var asyncResult = await hybridWebView.InvokeJavaScriptAsync<Dictionary<string, string>>(
Dictionary<string,string> asyncResult = await hybridWebView.InvokeJavaScriptAsync<Dictionary<string, string>>(
"EvaluateMeWithParamsAndAsyncReturn", // JavaScript method name
HybridSampleJSContext.Default.DictionaryStringString, // JSON serialization info for return type
["new_key", "new_value"], // Parameter values
Expand Down
Loading