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

Factory helpers for creating common ISub values. More...

Static Public Member Functions

static ISub FromAsyncEnumerable (Func< CancellationToken, IAsyncEnumerable< IMsg > > factory)
 Wrap an arbitrary IAsyncEnumerable<IMsg> factory as a subscription.
static ISub FromObservable (IObservable< IMsg > observable)
 Wrap an IObservable<IMsg> as a subscription.
static ISub Interval (TimeSpan interval, Func< DateTimeOffset, IMsg > fn)
 A subscription that fires fn every interval .

Detailed Description

Factory helpers for creating common ISub values.

Member Function Documentation

◆ FromObservable()

ISub ConsoleForge.Core.Sub.FromObservable ( IObservable< IMsg > observable)
static

Wrap an IObservable<IMsg> as a subscription.

Messages are forwarded until the token is cancelled or the observable completes.

◆ Interval()

ISub ConsoleForge.Core.Sub.Interval ( TimeSpan interval,
Func< DateTimeOffset, IMsg > fn )
static

A subscription that fires fn every interval .

Messages are produced indefinitely until the token is cancelled.


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