Connect<T, S extends T> class

The idea for connect comes from Anguar Signals with RxJS:

Start with a signal and then use the connect method to create a connector. Streams will feed Signal value.

final s = signal(0);
final c = connect(s);

to

Add streams to the connector.

final s = signal(0);
final c = connect(s);

final s1 = Stream.value(1);
final s2 = Stream.value(2);

c.from(s1).from(s2); // These can be chained

dispose

Cancel all subscriptions.

final s = signal(0);
final c = connect(s);

final s1 = Stream.value(1);
final s2 = Stream.value(2);

c.from(s1).from(s2);
// or
c << s1 << s2

c.dispose(); // This will cancel all subscriptions

@link https://dartsignals.dev/async/connect

Constructors

Connect(Signal<T> signal)
Connects a Stream to a Signal.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
signal Signal<T>
Internal signal to connect to.
final

Methods

dispose() → void
Cancels all subscriptions.
from(Stream<S> source, {bool? cancelOnError, Function? onError, Function? onDone, void onValue(T)?}) Connect<T, S>
Connects a Stream to a Signal.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator <<(Stream<S> source) Connect<T, S>
Synonym for from(Stream<T> source)
operator ==(Object other) bool
The equality operator.
inherited