https://github.com/soenneker/soenneker.blazor.utils.blazorinvoker
A generic invoker to simplify JavaScript to C# interaction
https://github.com/soenneker/soenneker.blazor.utils.blazorinvoker
blazor blazorinvoker csharp dotnet invoke invoker util utils
Last synced: 6 months ago
JSON representation
A generic invoker to simplify JavaScript to C# interaction
- Host: GitHub
- URL: https://github.com/soenneker/soenneker.blazor.utils.blazorinvoker
- Owner: soenneker
- License: mit
- Created: 2024-01-13T15:02:12.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-05-22T15:54:22.000Z (about 1 year ago)
- Last Synced: 2024-05-22T17:01:09.177Z (about 1 year ago)
- Topics: blazor, blazorinvoker, csharp, dotnet, invoke, invoker, util, utils
- Language: C#
- Homepage: https://soenneker.com
- Size: 323 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://www.nuget.org/packages/soenneker.blazor.utils.blazorinvoker/)
[](https://github.com/soenneker/soenneker.blazor.utils.blazorinvoker/actions/workflows/publish-package.yml)
[](https://www.nuget.org/packages/soenneker.blazor.utils.blazorinvoker/)#  Soenneker.Blazor.Utils.BlazorInvoker
### A generic invoker to simplify JavaScript to C# interaction`BlazorInvoker` is an encapsulation class designed as a generic invocation point from JS to C#. It's used for 'fire-and-forget' with no return value.
## Installation
```
dotnet add package Soenneker.Blazor.Utils.BlazorInvoker
```## Usage
### C#
```csharp
var stringInvoker = new BlazorInvoker(async (input) =>
{
await SomeAsyncOperation(input);
});
```### JS
```javascript
dotnetObject.invokeMethodAsync('Invoke', 'JavaScript argument');
```