Skip to content

Instantly share code, notes, and snippets.

@PatilShreyas
Last active October 22, 2023 06:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PatilShreyas/b3ad20f0fbc2a404c26762daea026c53 to your computer and use it in GitHub Desktop.
Save PatilShreyas/b3ad20f0fbc2a404c26762daea026c53 to your computer and use it in GitHub Desktop.
/**
* Transforms this flow into producing the subsequent items in the chunks (List<T>) after every
* specified duration.
*/
fun <T> Flow<T>.chunked(duration: Duration): Flow<List<T>> {
return TimeChunkedFlow(this, duration)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment