Soenneker.Blazor.Utils.ModuleImport
4.0.1779
Prefix Reserved
See the version list below for details.
dotnet add package Soenneker.Blazor.Utils.ModuleImport --version 4.0.1779
NuGet\Install-Package Soenneker.Blazor.Utils.ModuleImport -Version 4.0.1779
<PackageReference Include="Soenneker.Blazor.Utils.ModuleImport" Version="4.0.1779" />
<PackageVersion Include="Soenneker.Blazor.Utils.ModuleImport" Version="4.0.1779" />
<PackageReference Include="Soenneker.Blazor.Utils.ModuleImport" />
paket add Soenneker.Blazor.Utils.ModuleImport --version 4.0.1779
#r "nuget: Soenneker.Blazor.Utils.ModuleImport, 4.0.1779"
#:package Soenneker.Blazor.Utils.ModuleImport@4.0.1779
#addin nuget:?package=Soenneker.Blazor.Utils.ModuleImport&version=4.0.1779
#tool nuget:?package=Soenneker.Blazor.Utils.ModuleImport&version=4.0.1779
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 | net10.0 is compatible. 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. |
-
net10.0
- Soenneker.Blazor.Utils.JsVariable (>= 4.0.1268)
- Soenneker.Dictionaries.Singletons (>= 4.0.36)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.Blazor.Utils.ModuleImport:
| Package | Downloads |
|---|---|
|
Soenneker.Blazor.Utils.ResourceLoader
A Blazor JavaScript interop for dynamically loading scripts, styles, and modules |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 4.0.1780 | 0 | 3/13/2026 |
| 4.0.1779 | 0 | 3/13/2026 |
| 4.0.1778 | 0 | 3/13/2026 |
| 4.0.1777 | 0 | 3/13/2026 |
| 4.0.1776 | 0 | 3/13/2026 |
| 4.0.1775 | 0 | 3/12/2026 |
| 4.0.1774 | 19 | 3/12/2026 |
| 4.0.1773 | 20 | 3/12/2026 |
| 4.0.1771 | 37 | 3/12/2026 |
| 4.0.1770 | 44 | 3/12/2026 |
| 4.0.1769 | 55 | 3/12/2026 |
| 4.0.1768 | 53 | 3/12/2026 |
| 4.0.1767 | 53 | 3/12/2026 |
| 4.0.1766 | 50 | 3/12/2026 |
| 4.0.1765 | 2,017 | 3/11/2026 |
| 4.0.1764 | 427 | 3/11/2026 |
| 4.0.1763 | 357 | 3/11/2026 |
| 4.0.1762 | 592 | 3/11/2026 |
| 4.0.1761 | 56 | 3/11/2026 |
| 4.0.1760 | 402 | 3/11/2026 |
Update dependency Soenneker.Blazor.Utils.JsVariable to 4.0.1268 (#2115)