Articles
Conceptual guides and tutorials for DevBitsLab.Feeds.
Getting Started
Installation
Install the package via NuGet:
dotnet add package DevBitsLab.Feeds
Or via Package Manager Console:
Install-Package DevBitsLab.Feeds
Requirements
| Requirement | Supported Versions |
|---|---|
| .NET | 8.0, 10.0 |
| C# | 10+ (12+ recommended) |
C# Version Features:
- C# 10+: Full API support
- C# 13+: Partial property support for automatic
[BindableFeed]initialization
Basic Usage
using DevBitsLab.Feeds;
// Create a feed that loads data
var userFeed = Feed<User>.Create(async ct =>
await api.GetUserAsync(ct));
// React to state changes
userFeed.StateChanged += (s, e) => {
if (userFeed.HasValue)
Console.WriteLine($"Loaded: {userFeed.Value!.Name}");
};
// Or simply await
User user = await userFeed;
Core Concepts
- IFeed<T> Interface — Base interface for reactive feeds
- Feed<T> Class — Single-value reactive feed
- FeedState Enum — Feed state flags
List Feeds
- IListFeed<T> Interface — List feed interface
- ListFeed<T> Class — Reactive list with change tracking
- KeyedListFeed — O(1) key-based access and updates
- ListChange<T> Class — Change notification types
- ListFeedExtensions — LINQ-like operations (including SelectFrom)
State & Validation
- State<T> Class — Editable state with validation
- PropertyState<TParent, TProperty> — Two-way binding for record properties
- ValidationResult Class — Validation errors
Advanced
- CombinedFeed<TSource, TResult> — Combining multiple feeds
Platform Integration
- WinUI Integration — IncrementalListFeed, SelectionHelper, and keyed feeds
Tools
- Analyzers — Roslyn analyzers for best practices