Package 

Class OpenResultRecipientKt

    • Method Summary

      Modifier and Type Method Description
      final static <R extends Any> Unit onResult(OpenResultRecipient<R> $self, Function0<Unit> onCancelled, Function1<R, Unit> onValue) Like OpenResultRecipient.onNavResult but using a different API that may feel better in some cases.
      • Methods inherited from class java.lang.Object

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

      • onResult

        @Composable() final static <R extends Any> Unit onResult(OpenResultRecipient<R> $self, Function0<Unit> onCancelled, Function1<R, Unit> onValue)

        Like OpenResultRecipient.onNavResult but using a different API that may feel better in some cases.

        If you don't need to do anything when the result sender screen is cancelled without any value, you can:

            screenResult.onResult { resultValue ->
                println("got result $resultValue")
            }

        Otherwise:

             screenResult.onResult(
                 onValue = { resultValue ->
                     println("got result $resultValue")
                 },
                 onCancelled = {
                     println("did not get result")
                 }
            )