SingleFlightGroup

Dedupe multiple calls for a resource. A new SingleFlightGroup should be created for each async call that requires debouncing.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
suspend fun singleFlight(block: suspend () -> T): T

Executes block on the first invocation if there are no in-flight calls already made waiting for the response. If a call is already in-flight then waits for the response without kicking off a new call to block