Last active
April 13, 2022 11:40
-
-
Save manuelvicnt/9943e63dba2b87ad64f2f028303a629b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Copyright 2022 Google LLC. | |
SPDX-License-Identifier: Apache-2.0 */ | |
public fun LifecycleOwner.addRepeatingJob( | |
state: Lifecycle.State, | |
coroutineContext: CoroutineContext = EmptyCoroutineContext, | |
block: suspend CoroutineScope.() -> Unit | |
): Job = lifecycleScope.launch(coroutineContext) { | |
repeatOnLifecycle(state, block) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment