https://kotlinlang.org logo
#android
Title
# android
h

Hitanshu Dhawan

11/04/2019, 8:07 PM
Article to know the internals of
LiveData
and how it works. 👏 https://medium.com/androidiots/how-i-made-my-own-livedata-1faf4a45520
👏 2
a

Amirul Zin

11/05/2019, 1:37 AM
Be careful. This is not a thread safe implementation. Also, LiveData itself keep track of the value version. I suggest to look properly into internals. As per this reconstruction, it’s about halfway there I guess. Good effort 👍
h

Hitanshu Dhawan

11/05/2019, 5:12 AM
Hey, thanks for the feedback. Yes, I intentionally did not considered the thread safety to make the article simple to understand. And versioning is also handled in the above implementation of the LiveData. I tried to implement the same
android.arch.lifecycle.LiveData
and tried to explain my mindset and how did I approach making my own LiveData. This way it becomes clear as how its internal works.
6 Views