Files
BlazorDeviceInterop/BlazorDeviceInterop.Components/JsRuntimeObjectRef.cs
T
Bernard Darnton 9576c5aa5b Add project files.
2020-10-12 06:03:49 +13:00

21 lines
528 B
C#

using Microsoft.JSInterop;
using System;
using System.Text.Json.Serialization;
using System.Threading.Tasks;
namespace BlazorDeviceInterop.Components
{
public class JsRuntimeObjectRef : IAsyncDisposable
{
internal IJSRuntime JSRuntime { get; set; }
[JsonPropertyName("__jsObjRefId")]
public int JsObjectRefId { get; set; }
public async ValueTask DisposeAsync()
{
await JSRuntime.InvokeVoidAsync("deviceInterop.removeObjectRef", JsObjectRefId);
}
}
}