catchEventBoomerangWithLifecycleEvent

inline fun Fragment.catchEventBoomerangWithLifecycleEvent(key: String, lifecycleEvent: Lifecycle.Event = Lifecycle.Event.ON_START, crossinline onEvent: () -> Unit)

Extension function for Fragment that simplifies catching event notifications from the BoomerangStore. This is a specialized version of catchBoomerangWithLifecycleEvent specifically for handling simple event notifications without additional data.

This function should be called in the Fragment's onCreate method to not multiply the observers. Example usage

Parameters

key

The event key to catch

lifecycleEvent

The lifecycle event that triggers the catch attempt (default is ON_START)

onEvent

Callback function to execute when the event is caught

Throws

if the lifecycleEvent is not ON_START or ON_RESUME

if called after Fragment's onCreate, if the Fragment is not attached to an Activity, if the Activity does not implement BoomerangStoreHost, or if the BoomerangStore is not initialized