Benefit All Lifters 03 : suspend keyword in DAO - @Query that returns LiveData<T>

Dmitry Klokov·2021년 5월 5일
0

BENEFIT-ALL-LIFTERS

목록 보기
2/2

Case 01 : Suspend Keyword

CoroutinesRoom.execute

Case 02 : LiveData<T>

@Query("SELECT * FROM user ORDER BY userId DESC")
fun getAllUsers(): LiveData<List<User>>
// generated Database_Impl.java
@Override
public LiveData<List<User>> getAllUsers() {
	//...
	return __db.getInvalidationTracker().createLiveData(...)
}

profile
Power Weekend

0개의 댓글