Flow.NET 3.0.1

dotnet add package Flow.NET --version 3.0.1
                    
NuGet\Install-Package Flow.NET -Version 3.0.1
                    
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="Flow.NET" Version="3.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Flow.NET" Version="3.0.1" />
                    
Directory.Packages.props
<PackageReference Include="Flow.NET" />
                    
Project file
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 Flow.NET --version 3.0.1
                    
#r "nuget: Flow.NET, 3.0.1"
                    
#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 Flow.NET@3.0.1
                    
#: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=Flow.NET&version=3.0.1
                    
Install as a Cake Addin
#tool nuget:?package=Flow.NET&version=3.0.1
                    
Install as a Cake Tool

Flow

🏠 Introduction

Flow is a front-end library which provides tools for managing application state and data flow. It was designed for being used in the Blazor WASM applications to implement the flux pattern.

🚀 Getting started

The library provides a store container that contains stores with their nodes and values. You need to declare these stores in the service collection of our Blazor WASM application. Each store implements the IStore interface that allows to dispatch an action or get a node value. So you can use the default implementation DictionaryStoreDefinition or another custom store definition.

Installation

Package manager :

NuGet\Install-Package Flow.NET -Version 3.0.0

.NET CLI : dotnet add package Flow.NET --version 3.0.0

Declare the stores

To use Flow, you can use the following extension method to add it in the service collection of your application :

IServiceCollection AddFlow(this IServiceCollection serviceCollection, ICollection<IStore> stores)

Any store can be added if they implement the IStore interface. In these stores, you can declare the nodes that you want to use.

Example :

// Create the store used by the application
List<IStore> stores = new()
{
    new Store("MyStoreIdentifier", new DictionaryStoreDefinition(new string[] { "MyStoreNode" })), // Create a store with the DictionaryStoreDefinition class
    new Store<TypedStore>("MyTypedStoreIdentifier") // Constructor to create a store with the TypedStoreDefinition class
};
// Register the stores and the services
services.AddFlow(stores);

Dispatch an action

An action is an object that inherits of the IAction interface. We can update the state of the application by dispatching it to a store node.

For the moment, the StoreAction is the default implementation of the IAction interface and it allows to set the value of a node and to propagate the change to the node subscribers.

Example :

IStoreManager storeManager = storeContainer.GetStoreManager("MyStoreIdentifier");
IAction action = new StoreAction("MyStoreIdentifier", "MyStoreNode", valueObject);

// Dispatch the action
await storeManager.DispatchAsync(action);

or for typed stores (store registered with the TypedStoreDefinition class)

IStoreManager<TypedStore> storeManager = StoreContainer.GetStoreManager<TypedStore>("MyTypedStoreIdentifier");
IAction<int> action = new StoreAction<MyClass>("MyTypedStoreIdentifier", "MyTypedStoreNode", valueObject);

// Dispatch the action
await storeManager.DispatchAsync(action);

Get a node value

IStoreManager storeManager = storeContainer.GetStoreManager("MyStoreIdentifier");
storeManager.GetNodeValue("MyStoreNode") as MyClass;

or for typed stores (store registered with the TypedStoreDefinition class)

IStoreManager<TypedStore> storeManager = StoreContainer.GetStoreManager<TypedStore>("MyTypedStoreIdentifier");
storeManager.GetNodeValue<MyClass>("MyTypedStoreNode");

Update the properties that are connected to the store node

The component properties can subscribe to a store node. If an action is dispatched on this node, the properties are automatically impacted by the update. You can connect the properties with the following steps :

Connect a blazor component to the stores
@inherits ConnectedComponent
Connect a blazor component property to a node in a store
[StoreConnector("MyStore", "MyStoreNode")]
public MyClass MyProperty { get; set; }
Product 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.

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
3.0.1 158 4/24/2025
3.0.0 185 4/15/2025
2.1.0 297 12/4/2023
2.0.0 350 2/4/2023
1.0.0 283 2/4/2023