FluentSignals 1.1.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package FluentSignals --version 1.1.0
                    
NuGet\Install-Package FluentSignals -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="FluentSignals" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FluentSignals" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="FluentSignals" />
                    
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 FluentSignals --version 1.1.0
                    
#r "nuget: FluentSignals, 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 FluentSignals@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=FluentSignals&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=FluentSignals&version=1.1.0
                    
Install as a Cake Tool

FluentSignals

A powerful reactive state management library for .NET applications inspired by SolidJS signals. FluentSignals provides fine-grained reactivity with automatic dependency tracking, making it perfect for building responsive applications with minimal boilerplate.

Features

  • 🚀 Fine-grained reactivity - Only update what needs to be updated
  • 🔄 Automatic dependency tracking - No need to manually manage subscriptions
  • 📦 Typed and untyped signals - Use Signal<T> for type safety or Signal for flexibility
  • Async signals - Built-in support for asynchronous operations
  • 🌊 Computed signals - Automatically derive values from other signals
  • 🎯 Resource management - Generic resource pattern with loading/error states
  • 🌐 HTTP resources - Built-in HTTP client with caching and retry policies
  • 🔌 Extensible - Easy to extend with custom signal types

Installation

dotnet add package FluentSignals

Quick Start

Basic Signal Usage

using FluentSignals;

// Create a signal
var count = new Signal<int>(0);

// Subscribe to changes
count.Subscribe(value => Console.WriteLine($"Count is now: {value}"));

// Update the signal
count.Value = 1; // Output: Count is now: 1
count.Value = 2; // Output: Count is now: 2

Computed Signals

var firstName = new Signal<string>("John");
var lastName = new Signal<string>("Doe");

// Create a computed signal
var fullName = new ComputedSignal<string>(() => $"{firstName.Value} {lastName.Value}");

fullName.Subscribe(name => Console.WriteLine($"Full name: {name}"));

firstName.Value = "Jane"; // Output: Full name: Jane Doe

Async Signals

var asyncSignal = new AsyncSignal<string>(async () => 
{
    await Task.Delay(1000);
    return "Data loaded!";
});

// Access the value
await asyncSignal.GetValueAsync(); // Returns "Data loaded!" after 1 second

Resource Signals

// Create a resource with a fetcher function
var userResource = new ResourceSignal<User>(
    async (ct) => await LoadUserFromDatabase(userId, ct)
);

// Subscribe to state changes
userResource.Subscribe(state =>
{
    if (state.IsLoading) Console.WriteLine("Loading...");
    if (state.HasData) Console.WriteLine($"User: {state.Data.Name}");
    if (state.HasError) Console.WriteLine($"Error: {state.Error.Message}");
});

// Load the resource
await userResource.LoadAsync();

HTTP Resources

services.AddFluentSignalsHttpResource(options =>
{
    options.WithBaseUrl("https://api.example.com")
           .WithTimeout(TimeSpan.FromSeconds(30));
});

// Create an HTTP resource
var userResource = new HttpResource<User>("/users/1", httpClient);

// Subscribe and fetch
await userResource.LoadAsync();

Advanced Features

Signal Bus (Pub/Sub)

// Publisher
services.AddScoped<ISignalPublisher>();

await signalPublisher.PublishAsync(new UserCreatedEvent { UserId = 123 });

// Consumer
services.AddScoped<ISignalConsumer<UserCreatedEvent>>();

signalConsumer.Subscribe(message => 
{
    Console.WriteLine($"User created: {message.UserId}");
});

Queue-based Subscriptions

// Subscribe with message queue - receives all messages, even those published before subscription
subscription = signalConsumer.SubscribeByQueue(message =>
{
    ProcessMessage(message);
}, processExistingMessages: true);

Integration with Blazor

FluentSignals integrates seamlessly with Blazor applications. See the FluentSignals.Blazor package for Blazor-specific features and components.

Documentation

For more detailed documentation, examples, and API reference, visit our GitHub repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on FluentSignals:

Package Downloads
FluentSignals.Blazor

Blazor integration for FluentSignals - A reactive state management library. Includes SignalBus for component communication, HTTP resource components, typed resource factories, and Blazor-specific helpers.

FluentSignals.SignalBus

Event bus and messaging patterns for FluentSignals including publish/subscribe, message queuing, and advanced patterns like batching and multi-tenancy.

FluentSignals.SignalR

SignalR integration for FluentSignals providing real-time reactive resources with automatic reconnection and state management.

FluentSignals.Http

HTTP client extensions for FluentSignals including reactive HTTP resources, typed API clients, interceptors, caching, and advanced features for building robust HTTP integrations.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.1.5 112 7/17/2025
2.1.4 131 7/17/2025
2.1.3 134 7/15/2025
2.1.2 157 7/9/2025
2.1.1 161 7/8/2025
2.1.0 154 7/8/2025
2.0.0 147 6/29/2025
1.1.3 147 6/19/2025
1.1.2 148 6/17/2025
1.1.1 145 6/16/2025
1.1.0 143 6/16/2025
1.0.0 134 6/15/2025