Skip to content

Connect

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