FluxLib 1.1.0
dotnet add package FluxLib --version 1.1.0
NuGet\Install-Package FluxLib -Version 1.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FluxLib" Version="1.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FluxLib" Version="1.1.0" />
<PackageReference Include="FluxLib" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FluxLib --version 1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FluxLib, 1.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FluxLib@1.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FluxLib&version=1.1.0
#tool nuget:?package=FluxLib&version=1.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FluxLib
A library to support flux design.
Flux design
+---------+ +-------------+ +--------+ +--------+
| Action | -----> | Dispatcher | -----> | Store | -----> | View |
+---------+ +-------------+ +--------+ +--------+
^ |
|-------------------------------------------------------+
(User interaction triggers new Action)
- User interacts with the View (e.g., clicking a button).
- This triggers an Action.
- The Dispatcher receives the action and sends it to the appropriate Store.
- The Store updates its internal state based on the action.
- The Store emits a change event.
- The View listens for these changes and re-renders accordingly.
- The cycle repeats as the user continues to interact.
Explanation of this library
This library provides the following components: DispatchCenter, IStore, ActionArgs, and DataArgs.
ActionArgsis a class used to define the action type and the data required for that action. It facilitates communication in the flow:View -> Dispatcher -> Store.DataArgsis a class used to define the data type and the data being passed. It facilitates communication in the flow:Store -> View.
- The
DispatchCenterclass receivesActionArgsfrom the View and broadcasts them to allIStoreinstances that are listening to it.
Example: Listening for an action in a Store
// SimpleAction is an enum that defines various actions associated with `SimpleView`
_dispatchCenter.AddListener(typeof(SimpleAction), ActionReceived);
private void ActionReceived(object? sender, ActionArgs e) {
...
}
- The Store processes the received action and emits a change event to all Views that are subscribed to it.
Example: Emiting a change in a Store
var data = new DataArgs();
data.AddData(SimpleTag.Text, str);
// Push the processed result to the subscribers
Changed?.Invoke(this, data); // `Changed` is the event defined in `IStore`
Example: Listening for changes in a View
public SimpleView(DispatchCenter dispatchCenter, SimpleStore store)
{
_dispatcherCenter = dispatchCenter;
_store = store;
_store.Changed += Store_Changed; // Subscribe to store change events
}
- The View sends actions to the
DispatchCenter.
Example: Sending an action to DispatchCenter
var action = new ActionArgs(SimpleAction.Repeat);
action.AddData(SimpleTag.Text, input);
// Dispatch the action to all subscribers
_dispatcherCenter.DispatchEvent(action);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. 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. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.0 | 372 | 7/9/2025 |