Skip to content

v1.1.0

Compare
Choose a tag to compare
@Fi5t Fi5t released this 06 Aug 13:43
· 50 commits to master since this release
1.1.0

PINkman meets the asynchronous world.

PINkman adds support for Kotlin Coroutines and RxJava 3. From this release on, you can call several methods in async manner:

fun createPinAsync(...): Completable
fun changePinAsync(...): Completable
fun isValidPinAsync(...): Single<Boolean>

// Coroutines
suspend fun createPinAsync(...)
suspend fun changePinAsync(...)
suspend fun isValidPinAsync(...): Boolean

So, you can refactor your CreatePinViewModel as following:

class CreatePinViewModel @ViewModelInject constructor(private val pinkman: Pinkman) : ViewModel() {

    val pinIsCreated = MutableLiveData<Boolean>()

    fun createPin(pin: String) {
        viewModelScope.launch { 
            pinkman.createPinAsync(pin)
            pinIsCreated.postValue(true)
        }
    }
}

Changes

Added