rodydavis / signals.dart

Reactive programming made simple for Dart and Flutter
http://dartsignals.dev
Apache License 2.0
437 stars 50 forks source link

Better type safety on Connect #214

Closed mcmah309 closed 6 months ago

mcmah309 commented 6 months ago

Before this PR, this would will not have any issues at compile time, but will throw at runtime

  final intStream = Stream.fromIterable(<int>[1]);
  final stringSignal = signal("string");
  final c = connect(stringSignal, intStream);

Since this becomes

  final Stream<int> intStream = Stream.fromIterable(<int>[1]);
  final Signal<String> stringSignal = signal("string");
  final Connect<Object> c = connect(stringSignal, intStream);
rodydavis commented 6 months ago

I am curious why the generic is not picking up the correct type for the stream. But PR LGTM

mcmah309 commented 6 months ago

@rodydavis Do you need me to do something on my end? It's telling me "2 workflows awaiting approval This workflow requires approval from a maintainer" on my end.

rodydavis commented 6 months ago

Approved and it will check!

mcmah309 commented 6 months ago

One workflow succeeded, the other was cancelled? Still didn't see a way to merge, so I updated the branch and now back at square one 🫤