Soenneker.Blazor.Utils.ModuleImport
3.0.659
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Blazor.Utils.ModuleImport --version 3.0.659
NuGet\Install-Package Soenneker.Blazor.Utils.ModuleImport -Version 3.0.659
<PackageReference Include="Soenneker.Blazor.Utils.ModuleImport" Version="3.0.659" />
<PackageVersion Include="Soenneker.Blazor.Utils.ModuleImport" Version="3.0.659" />
<PackageReference Include="Soenneker.Blazor.Utils.ModuleImport" />
paket add Soenneker.Blazor.Utils.ModuleImport --version 3.0.659
#r "nuget: Soenneker.Blazor.Utils.ModuleImport, 3.0.659"
#:package Soenneker.Blazor.Utils.ModuleImport@3.0.659
#addin nuget:?package=Soenneker.Blazor.Utils.ModuleImport&version=3.0.659
#tool nuget:?package=Soenneker.Blazor.Utils.ModuleImport&version=3.0.659
Soenneker.Blazor.Utils.ModuleImport
A Blazor utility library assisting with asynchronous module loading
This library simplifies the process of loading JavaScript modules and provides methods for waiting until a module is loaded and disposing of modules when they are no longer needed.
Features
- Import JavaScript modules dynamically.
- Wait until a module is fully loaded.
- Dispose of JavaScript modules when they are no longer needed.
- Singleton pattern to ensure that each module is loaded only once.
Installation
To install, add the package to your Blazor project using the .NET CLI:
dotnet add package Soenneker.Blazor.Utils.ModuleImport
Register it in DI:
builder.Services.AddModuleImportUtil();
Example
Here's an example of how to use the ModuleImportUtil in a Blazor component:
@page "/example"
@inject IModuleImportUtil ModuleImportUtil
@implements IAsyncDisposable
<h3>Module Import Example</h3>
<button @onclick="LoadModule">Load Module</button>
@code {
private async Task LoadModule()
{
var module = await ModuleImportUtil.Import("exampleModule");
await ModuleImportUtil.WaitUntilLoaded("exampleModule");
// Guaranteed that the module has been added to the DOM, and available at this point
}
public async ValueTask DisposeAsync()
{
await ModuleImportUtil.DisposeModule("exampleModule");
}
}
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net9.0
- Soenneker.Blazor.Utils.JsVariable (>= 3.0.424)
- Soenneker.Utils.SingletonDictionary (>= 3.0.594)
NuGet packages (17)
Showing the top 5 NuGet packages that depend on Soenneker.Blazor.Utils.ModuleImport:
| Package | Downloads |
|---|---|
|
Soenneker.Blazor.Utils.JsVariable
A Blazor interop library that checks (and waits) for the existence of a JS variable |
|
|
Soenneker.Blazor.Clarity
A small Blazor interop library that sets up Microsoft Clarity |
|
|
Soenneker.Blazor.LogJson
A Blazor interop library that logs JSON (like HTTP requests/responses) within the browser |
|
|
Soenneker.Blazor.ApplicationInsights
A Blazor interop library that sets up client-side Application Insights |
|
|
Soenneker.Blazor.MediaQuery
A Blazor interop library for media queries for viewport size logic |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1816 | 137 | 6/10/2026 |
| 4.0.1815 | 1,254 | 6/9/2026 |
| 4.0.1814 | 4,438 | 6/7/2026 |
| 4.0.1813 | 1,636 | 6/6/2026 |
| 4.0.1812 | 1,006 | 6/6/2026 |
| 4.0.1811 | 1,171 | 6/6/2026 |
| 4.0.1810 | 135 | 6/5/2026 |
| 4.0.1809 | 200 | 6/5/2026 |
| 4.0.1808 | 344 | 6/5/2026 |
| 4.0.1807 | 93 | 6/5/2026 |
| 4.0.1806 | 13,249 | 5/13/2026 |
| 4.0.1805 | 2,080 | 5/12/2026 |
| 4.0.1804 | 8,617 | 5/2/2026 |
| 4.0.1803 | 6,795 | 4/24/2026 |
| 4.0.1802 | 1,313 | 4/23/2026 |
| 4.0.1801 | 1,418 | 4/23/2026 |
| 4.0.1800 | 807 | 4/22/2026 |
| 4.0.1799 | 186 | 4/22/2026 |
| 4.0.1798 | 245 | 4/22/2026 |
| 3.0.659 | 1,350 | 11/21/2024 |