Skip to content

Instantly share code, notes, and snippets.

@shredderskelton
Created February 21, 2021 12:07
Show Gist options
  • Select an option

  • Save shredderskelton/2bdc705ce83cde06826eb4f548f71a08 to your computer and use it in GitHub Desktop.

Select an option

Save shredderskelton/2bdc705ce83cde06826eb4f548f71a08 to your computer and use it in GitHub Desktop.
Hot Flow Turbine
@Test
fun `hot flow - Turbine`() {
runBlocking {
MutableStateFlow("test").test {
assertThat(expectItem()).isEqualTo("test")
cancelAndIgnoreRemainingEvents()
}
}
}
@Test
fun `hot flow alternative - Turbine`() {
runBlocking {
MutableStateFlow("test").test {
assertThat(expectItem()).isEqualTo("test")
cancelAndConsumeRemainingEvents()
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment