DistinctStateEffect

fun <T : Any> DistinctStateEffect(state: T?, isDistinct: (previous: T?, current: T?) -> Boolean = StatePredicates.distinctValue, onDistinctChange: (previous: T?, current: T?) -> Unit)

This invokes onDistinctChange when the state changes according to isDistinct. Used to trigger events when the state changes.

This function exists in the analytics package because that might be its primary use. If found useful for other cases, it should be moved to a more general package.