package com.atmob.keyboard_android.ext

import androidx.lifecycle.LifecycleOwner
import androidx.lifecycle.LiveData
import androidx.lifecycle.Observer

/**
 * 拓展LiveData的observe方法，设置观察者后，返回自身
 */
fun <T> LiveData<T>.observeNow(
    owner: LifecycleOwner, observer: Observer<in T>
): LiveData<T> {
    observe(owner, observer)
    return this
}