Table of Contents

API Reference

This section contains auto-generated API documentation from the source code.

Browse the namespaces and types in the table of contents.

Thread Safety

All types in DevBitsLab.Feeds are designed to be thread-safe:

Type Thread-Safe Notes
Feed<T> ✅ Yes All operations safe from any thread
ListFeed<T> ✅ Yes Internal locking, atomic batch updates
State<T> ✅ Yes Concurrent saves are queued
CombinedFeed<TSource, TResult> ✅ Yes Inherits from source feeds
ValidationResult ✅ Yes Immutable after creation

Key Guarantees

  • Property access — Safe to read Value, State, IsLoading, etc. from any thread
  • MutationsUpdate, Upsert, Add, Remove, etc. are all thread-safe
  • Async operationsRefreshAsync, SaveAsync, RevertAsync can be called concurrently
  • Event subscriptions — Adding/removing handlers is thread-safe

Event Handler Threading

⚠️ Important: Event handlers execute on the thread that triggered the state change. When updating UI, marshal to the UI thread:

// WPF
feed.StateChanged += (s, e) => 
    Dispatcher.Invoke(() => UpdateUI());

// WinUI / MAUI
feed.StateChanged += (s, e) => 
    DispatcherQueue.TryEnqueue(() => UpdateUI());

Core Types

Type Description
IFeed<T> Base interface for reactive feeds
Feed<T> Single-value reactive feed
ListFeed<T> Reactive list with change tracking
State<T> Editable state with validation
FeedState Feed state flags enum
ValidationResult Validation error container
CombinedFeed<TSource, TResult> Feed composition

Namespace

All types are in the DevBitsLab.Feeds namespace:

using DevBitsLab.Feeds;