Gjallarhorn


SignalExtensions

Namespace: Gjallarhorn.Linq

Extension methods for working with Signals from C# using a LINQ inspired API

Constructors

ConstructorDescription
new()
Signature: unit -> SignalExtensions

CompiledName: .ctor

Static members

Static memberDescription
And(this, other)
Signature: (this:ISignal<bool> * other:ISignal<bool>) -> ISignal<bool>

Creates a signal on two bools that is true if both inputs are true

Cached(this)
Signature: this:ISignal<'a> -> ISignal<'a>
Type parameters: 'a

Create a cached signal over a provider This will not hold a reference to the provider, and will allow it to be garbage collected. As such, it caches the "last valid" state of the signal locally.

CopyTo(this, target)
Signature: (this:ISignal<'a> * target:IMutatable<'a>) -> IDisposable
Type parameters: 'a

Create a subscription to the changes of a signal which copies its value upon change into a mutable

Equal(this, other)
Signature: (this:ISignal<'a> * other:ISignal<'a>) -> ISignal<bool>
Type parameters: 'a

Creates a signal on two values that is true if both inputs are equal

Merge(this, other)
Signature: (this:ISignal<'a> * other:ISignal<'a>) -> ISignal<'a>
Type parameters: 'a

Merges two signals into a single signal. The value from the second signal is used as the initial value of the result

Not(this)
Signature: this:ISignal<bool> -> ISignal<bool>

Creates a signal over a bool value that negates the input

NotEqual(this, other)
Signature: (this:ISignal<'a> * other:ISignal<'a>) -> ISignal<bool>
Type parameters: 'a

Creates a signal on two values that is true if both inputs are not equal

ObserveOn(this, context)
Signature: (this:ISignal<'a> * context:SynchronizationContext) -> ISignal<'a>
Type parameters: 'a

Creates a signal that schedules on a synchronization context

Or(this, other)
Signature: (this:ISignal<bool> * other:ISignal<bool>) -> ISignal<bool>

Creates a signal on two bools that is true if either input is true

Select(this, mapper)
Signature: (this:ISignal<'a> * mapper:Func<'a,'b>) -> ISignal<'b>
Type parameters: 'a, 'b

Perform a mapping from one signal to another

SelectAsync(...)
Signature: (this:ISignal<'a> * initialValue:'b * tracker:IdleTracker * mapper:Func<'a,Task<'b>>) -> ISignal<'b>
Type parameters: 'a, 'b

Perform an asynchronous mapping from one signal to another, tracking execution via an IdleTracker

SelectAsync(this, initialValue, mapper)
Signature: (this:ISignal<'a> * initialValue:'b * mapper:Func<'a,Task<'b>>) -> ISignal<'b>
Type parameters: 'a, 'b

Perform an asynchronous mapping from one signal to another

SelectMany(this, mapper, selector)
Signature: (this:ISignal<'a> * mapper:Func<'a,ISignal<'b>> * selector:Func<'a,'b,'c>) -> ISignal<'c>
Type parameters: 'a, 'b, 'c

Perform a projection from a signal, typically only used for query syntax

SelectMany(this, mapper)
Signature: (this:ISignal<'a> * mapper:Func<'a,ISignal<'b>>) -> ISignal<'b>
Type parameters: 'a, 'b

Perform a projection from a signal, typically only used for query syntax

Subscribe(this, func)
Signature: (this:ISignal<'a> * func:Action<'a>) -> IDisposable
Type parameters: 'a

Create a subscription to the changes of a signal which calls the provided function upon each change

SubscribeAndUpdate(...)
Signature: (this:ISignal<'a> * target:IMutatable<'b> * stepFunction:Func<'b,'a,'b>) -> IDisposable
Type parameters: 'a, 'b

Create a subscription to the changes of a signal which copies its value upon change into a mutable via a stepping function

When(this, filter)
Signature: (this:ISignal<'a> * filter:ISignal<bool>) -> ISignal<'a>
Type parameters: 'a

Filters the signal by using a separate bool signal The resulting signal always begins with the input value.

When(this, filter, defaultValue)
Signature: (this:ISignal<'a> * filter:ISignal<bool> * defaultValue:'a) -> ISignal<'a>
Type parameters: 'a

Filters the signal by using a separate bool signal If the condition's Value is initially false, the resulting signal begins with the provided defaultValue.

Where(this, filter, defaultValue)
Signature: (this:ISignal<'a> * filter:Func<'a,bool> * defaultValue:'a) -> ISignal<'a>
Type parameters: 'a

Perform a filter from one signal to another based on a predicate. The defaultValue is used to initialize the output signal if the input doesn't match the predicate

Where(this, filter)
Signature: (this:ISignal<'a> * filter:Func<'a,bool>) -> ISignal<'a>
Type parameters: 'a

Perform a filter from one signal to another based on a predicate. This will raise an exception if the input value does not match the predicate when created.

Fork me on GitHub