Open wstrange opened 2 months ago
Definitely want to add examples to the docs!
https://dartsignals.dev/async/connect/
The biggest reason to use it over StreamSignal is you work off of type T instead of AsyncState
In the example in the docs, how do you actually "advance" or consume the signal value when a new value is emitted from a stream? A more concrete example would really help. Something that consumes the connected signal.
You mean outside of using an effect?
You mean outside of using an effect?
I'm honestly not sure I know the right question to ask.
If I have a Stream<Foo>
I know I can create a stream signal from that. In my widget I'm going to get objects of AsyncState<Foo>
- which is fine, I understand how to handle those (somewhat verbose, but it works).
Your previous comment implied I can 'connect' the stream to a non async signal, so my widget only deals with type Foo
? And presumably only gets updated when the stream emits a new Foo
into the "connected" signal?
A more complex example, ideally with a Flutter widget would really help.
Not grokking how connect() works or why I would want to use it.
Some docs would be great!