consumeSerializableWithLifecycleEvent

inline fun <T : @Serializable Any> Fragment.consumeSerializableWithLifecycleEvent(key: String, lifecycleEvent: Lifecycle.Event = Lifecycle.Event.ON_START, crossinline catcher: (T) -> Unit)(source)

Extension function for Fragment that consumes serializable objects of type T at a specific lifecycle event.

This function is similar to catchSerializableWithLifecycleEvent but automatically returns true after the catcher function is called, indicating that the object was successfully handled.

Parameters

T

The type of serializable object to consume

key

The unique identifier for this consumer, used to match the thrown object

lifecycleEvent

The lifecycle event at which to consume the object, defaults to Lifecycle.Event.ON_START

catcher

A function that processes the caught object without needing to return a handling status


inline fun <T : @Serializable Any> Fragment.consumeSerializableWithLifecycleEvent(lifecycleEvent: Lifecycle.Event = Lifecycle.Event.ON_START, crossinline catcher: (T) -> Unit)(source)

Extension function for Fragment that consumes serializable objects of type T at a specific lifecycle event.

This overload automatically uses the qualified name of type T as the key and is similar to catchSerializableWithLifecycleEvent but automatically returns true after the catcher function is called, indicating that the object was successfully handled.

Parameters

T

The type of serializable object to consume

lifecycleEvent

The lifecycle event at which to consume the object, defaults to Lifecycle.Event.ON_START

catcher

A function that processes the caught object without needing to return a handling status