Package 

Class FlowExtensionsKt

    • Method Summary

      Modifier and Type Method Description
      final static <T extends Any> LiveData<T> asLiveData(StateFlow<T> $self) Extension function to convert a StateFlow to LiveData for backward compatibility.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • asLiveData

         final static <T extends Any> LiveData<T> asLiveData(StateFlow<T> $self)

        Extension function to convert a StateFlow to LiveData for backward compatibility.

        This is useful for developers who want to continue using LiveData-based observers in their UI layer while benefiting from the StateFlow-based SDK API.

        Example usage:

        val session: ConversationSession = ConversationClient.startSession(config, context)
        val statusLiveData: LiveData<ConversationStatus> = session.status.asLiveData()
        
        statusLiveData.observe(viewLifecycleOwner) { status ->
            // Handle status changes
        }