개발노트/Kotlin
파이널 프로젝트 3주차 2일 swith map
시계속세상은아직돌아가는중
2023. 10. 24. 17:57
1) livedata를 동적으로 바로바로 꽂아넣고 싶음
2) Transformations을 사용하면 가능함
3)현재 Transformations가 지원하지 않음
4)따라서 switch map을 사용함
sharedflow를 사용해보자
참고 사이트
Unresolved reference: Transformations after upgrading lifecycle dependency
After upgrading the lifecycle dependency from 2.6.0-alpha04 to 2.6.0-beta01 I got Unresolved reference: Transformations and it can't import androidx.lifecycle.Transformations class. import androidx.
stackoverflow.com
https://velog.io/@hyom/AndroidKotlin-Transformations.map-vs-switchMap
[Android/Kotlin] Transformations.map() vs switchMap()
LiveData map (LiveData source, Function<X, Y> func): LiveData 타입 데이터를 LiveData 타입 데이터로 변환합니다. func에서는 Y 타입의 객체를 리턴.LiveData switchMap (LiveData tri
velog.io