-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Description
The file is missing implementing IAsyncDisposable/IDisposable. The blazor framework won't recognize the Dispose() method and it will never get executed.
I think it needs
@implements IAsyncDisposableThe IJSObjectReference module needs to get disposed of too, and we need a private field for it.
private IJSObjectReference? module;
protected override async Task OnAfterRenderAsync(bool firstRender)
{
if (firstRender)
{
selfReference = DotNetObjectReference.Create(this);
// Should module get disposed of as well?
module = await JS.InvokeAsync<IJSObjectReference>("import", "./Shared/SortableList.razor.js");
await module.InvokeAsync<string>("init", Id, Group, Pull, Put, Sort, Handle, Filter, selfReference, ForceFallback);
}
}And finally
public async ValueTask DisposeAsync()
{
selfReference?.Dispose();
await module!.DisposeAsync();
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels