mirror of
https://github.com/Aviortheking/Neo-Store.git
synced 2025-06-19 05:49:18 +00:00
Add: ManageableLiveData
This commit is contained in:
@ -0,0 +1,14 @@
|
||||
package com.looker.droidify.utility.extension
|
||||
|
||||
import androidx.lifecycle.MediatorLiveData
|
||||
|
||||
class ManageableLiveData<T> : MediatorLiveData<T>() {
|
||||
var lastEdit: Long = 0L
|
||||
|
||||
fun updateValue(value: T, updateTime: Long) {
|
||||
if (updateTime > lastEdit) {
|
||||
lastEdit = updateTime
|
||||
super.postValue(value)
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user