T - The type of the live datapublic abstract class KriptonComputableLiveData<T> extends Object
This is an internal class for now, might be public if we see the necessity.
| Constructor and Description |
|---|
KriptonComputableLiveData()
Creates a computable live data which is computed when there are active observers.
|
| Modifier and Type | Method and Description |
|---|---|
protected abstract T |
compute()
Compute.
|
KriptonLiveData<T> |
getLiveData()
Returns the LiveData managed by this class.
|
void |
invalidate()
Invalidates the LiveData.
|
public KriptonComputableLiveData()
It can also be invalidated via invalidate() which will result in a call to
compute() if there are active observers (or when they start observing)
@NonNull public KriptonLiveData<T> getLiveData()
public void invalidate()
When there are active observers, this will trigger a call to compute().
@WorkerThread protected abstract T compute()
Copyright © 2018. All rights reserved.