ConsoleForge 0.3.0
Elm-architecture TUI framework for .NET 8
Loading...
Searching...
No Matches
ConsoleForge.Core.IHasSubscriptions Interface Reference

Optional interface for models that declare long-running subscriptions. More...

Public Member Functions

IReadOnlyList<(string Key, ISub Sub)> Subscriptions ()
 Return the set of subscriptions that should be active given the current model state.

Detailed Description

Optional interface for models that declare long-running subscriptions.

Implement alongside IModel to participate in subscription management.

After every Update call the framework invokes Subscriptions and compares the returned set (by subscription key) with the currently running set. New subscriptions are started; subscriptions whose key is no longer present are cancelled.

Member Function Documentation

◆ Subscriptions()

IReadOnlyList<(string Key, ISub Sub)> ConsoleForge.Core.IHasSubscriptions.Subscriptions ( )

Return the set of subscriptions that should be active given the current model state.

Each entry is a (key, sub) pair. The key uniquely identifies the subscription — use a stable string (e.g. a feature flag name or device id) so the framework can detect start/stop transitions.


The documentation for this interface was generated from the following file:
  • src/ConsoleForge/Core/ISub.cs