New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Revisit documentation #161
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice
} | ||
``` | ||
|
||
Like `test`, `testIn` produces a `ReceiveTurbine`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ReceiveTurbine
as a type was not mentioned above in the test
section.
That section probably just needs a quick tweak like
Then it calls the validation block, passing in the read-only interface
ReceiveTurbine
as the receiver:
README.md
Outdated
While flow termination is exposed as an event, it is not really an event: it's a state that the flow is in. | ||
So completion or error events can be observed multiple times. | ||
|
||
```kotlin | ||
flow<Nothing> { throw RuntimeException("broken!") }.test { | ||
awaitError() | ||
awaitError() | ||
awaitError() | ||
} | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure whether this meets that bar for the intro/README. It's a great snippet to put on the kdoc of each of these functions (which we should do no matter what), but I'm unsure as to whether it's something important enough to actively communicate here. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me. I was very worried about this README getting too long, so.... happy to have a reason to delete something
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already documented well enough, I think:
/**
* Assert that the next event received was an error terminating the flow.
* This function will suspend if no events have been received.
*
* When this [ReceiveTurbine] is in a terminal state ([Event.Complete] or [Event.Error], this method
* will yield the same result every time it is called.
*
* @throws AssertionError if the next event was an item or completion.
*/
e80858c
to
d398b12
Compare
No description provided.