The EventHorizon.Blazor.Server.Interop is a slim project I created to help with common Blazor JavaScript Interop actions. This project is a derived work from the canhorn/EventHorizon.Blazor.Interop project that works with Blazor Server, with the caveat of not having the performance the other has.
The canhorn/EventHorizon.Blazor.Interop is focused on WASM, and provides the best interop performance between .NET and the JavaScript client code.
This library requires the usage of the IJSRuntime, you will need to attach one manually before usage.
In "App.razor"
@code {
[Inject]
public IJSRuntime JSRuntime { get; set; }
protected override void OnInitialized()
{
EventHorizonBlazorInterop.JSRuntime = JSRuntime;
}
}
The EventHorizon.Blazor.Server.Interop.Sample Project contains a suite of performance tests.