launchOnCreated

inline fun LifecycleOwner.launchOnCreated(lazyThreadSafetyMode: LazyThreadSafetyMode = LazyThreadSafetyMode.NONE, crossinline block: suspend CoroutineScope.() -> Unit): Lazybones<Job>

Author

skydoves (Jaewoong Eum)

Returns a Job lazily via Lazybones delegate for invoking the block on the onCreated lifecycleScope.

Return

Lazybones A lazybones wrapper for creating a lifecycle-aware property.

Parameters

lazyThreadSafetyMode

Specifies how a Lazy instance synchronizes initialization among multiple threads.

block

A block that will be executed on the specific lifecycle.

inline fun <T> LifecycleOwner.launchOnCreated(flow: Flow<T>, lazyThreadSafetyMode: LazyThreadSafetyMode = LazyThreadSafetyMode.NONE, crossinline block: (T) -> Unit): Lazybones<Job>

Author

skydoves (Jaewoong Eum)

Returns a Job lazily via Lazybones delegate for invoking the collected block from the Flow on the onCreated lifecycleScope.

Return

Lazybones A lazybones wrapper for creating a lifecycle-aware property.

Parameters

flow

A flow that will be collected on the specific lifecycle.

lazyThreadSafetyMode

Specifies how a Lazy instance synchronizes initialization among multiple threads.

block

A block that will be executed on the specific lifecycle.