Clarify object disposal for IJSObjectReference (#23516)

pull/23517/head
Luke Latham 2021-10-12 07:44:41 -05:00 committed by GitHub
parent 4295e26c8a
commit 3b24b1a3ff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -193,6 +193,7 @@ In the preceding example:
* Specify the module's external JS file using its stable static web asset path: `./{SCRIPT PATH AND FILENAME (.js)}`, where: * Specify the module's external JS file using its stable static web asset path: `./{SCRIPT PATH AND FILENAME (.js)}`, where:
* The path segment for the current directory (`./`) is required in order to create the correct static asset path to the JS file. * The path segment for the current directory (`./`) is required in order to create the correct static asset path to the JS file.
* The `{SCRIPT PATH AND FILENAME (.js)}` placeholder is the path and file name under `wwwroot`. * The `{SCRIPT PATH AND FILENAME (.js)}` placeholder is the path and file name under `wwwroot`.
* Dispose the <xref:Microsoft.JSInterop.IJSObjectReference> for [efficient garbage collection](xref:blazor/components/lifecycle#asynchronous-iasyncdisposable) in <xref:System.IAsyncDisposable.DisposeAsync%2A?displayProperty=nameWithType>.
Dynamically importing a module requires a network request, so it can only be achieved asynchronously by calling <xref:Microsoft.JSInterop.IJSRuntime.InvokeAsync%2A>. Dynamically importing a module requires a network request, so it can only be achieved asynchronously by calling <xref:Microsoft.JSInterop.IJSRuntime.InvokeAsync%2A>.