s

    SK

    6 months ago
    @alex009 We have upgraded moko to 0.12 and all the usages of postValue in the ViewModel are shown as errors. Whats the suggested workaround? How do we set values to the MutableLiveData? We have a huge codebase.
    alex009

    alex009

    6 months ago
    postValue now is extension function. just add import for it. but this extension exists only for mobile targets (android, ios)
    s

    SK

    6 months ago
    Should the viewmodels be moved to mobileMain? Our code is common for android/ios.
    alex009

    alex009

    6 months ago
    no
    s

    SK

    6 months ago
    Are you suggesting the ViewModels to be split between android and ios? And no more sharing code?
    alex009

    alex009

    6 months ago
    no
    just add import
    dev.icerock.moko.mvvm.livedata.postValue
    nothing more.
    s

    SK

    6 months ago
    Ok and leave everything in commonMain. Let me try.
    Great, it did compile successfully now. Thanks. Android Studio editor still thinks it's an error and can't find the extension. Is it because it's in commonMain? Anyway to resolve this?
    alex009

    alex009

    6 months ago