Closed Wizzel1 closed 2 weeks ago
calling await ref.watch(chatProvider.future); resolves after the first yield for me. Is this expected?
I don't get what this means. Could you expand on what you mean by resoles after the first yield
?
calling await ref.watch(chatProvider.future); resolves after the first yield for me. Is this expected?
I don't get what this means. Could you expand on what you mean by
resoles after the first yield
?
I mean whenever the stream emits its first value(the first message in chatProvider), the future is completed.
I was looking for a way to await the "last" emit in a list of known events.
Someone in the discord channel told me that this is expected: https://discord.com/channels/765557403865186374/765557404766830614/1232636327573327873
I am now using fakeAsync to await the completion of my stream.
Yes this is expected. Using .future
returns the most recently emitted value.
Describe the bug Given the example from the docs:
calling
await ref.watch(chatProvider.future);
resolves after the first yield for me. Is this expected?I am trying to write tests for my stream provider :
this always fails because the
myTestRepo.myMethod
call gets called after the first yield.What am I doing wrong?
Expected behavior I expected the future to resolve after the last yield