Thread
#compose
    Shakil Karim

    Shakil Karim

    1 year ago
    Hi, what is the difference between these two function definition, in terms of when the backing MutableState changes? fun Demo (coin: State<Int>) vs fun Demo(coin: Int)
    Albert Chang

    Albert Chang

    1 year ago
    If these are composable functions, I don’t think there’s any difference but you should use the latter form as the parameter doesn’t necessarily have to be a
    State
    .
    Shakil Karim

    Shakil Karim

    1 year ago
    @Albert Chang Yes, it is Composable functions, thanks i though latter one won,t recompose when it's data changes.
    n

    nglauber

    1 year ago
    You must definitely choose the second one… This is the definition of unidirectional data flow: “State flows down, events flows up” https://developer.android.com/jetpack/compose/state#state-hoisting