Comments (5)
point 4 :
some device have this error (with old api Android)
Nexus 6p - Android 8.1 doesn't have this mistake
from livedata-ktx.
Hi @Kadanza, I missed your original message. Thanks for reaching out. Hopefully, I can address some of your questions below:
- what improvement has version 3.0.0?
- why need MutableLiveDataKtx instead MutableLiveData?
As listed in the README, v3 focuses on Kotlin friendly, preserve immutability, and extensibility. For instance, you still can set null value for a non-null LiveData which can cause NPE at runtime. Compiler should be able to prevent it.
// Allow to set null value to LiveData
val liveData = MutableLiveData<Boolean>()
liveData.value = null
// LiveDataKtx doesn't allow to null value
val liveData = MutableLiveDataKtx<Boolean>()
liveData.value = null // doesn't allow
// Set nullable in LiveDataKtx
val liveData = MutableLiveDataKtx<Boolean?>()
liveData.value = null
- In version 2.0 we has great extension observe without Observer
There is tradeoffs for the approach. Kotlin lambda generates different object down to Java layer which makes harder to remove the observer later on.
- In version 2.0 I has unpleasant bug in android studio
I haven't encountered this issue. I can take a look later.
from livedata-ktx.
point 3 : are you not recommend use version 2 because of problem with memory?
I use version 2 widely
from livedata-ktx.
If you use v2.0.2, removeObserver
should work properly as we had a fix for it https://github.com/Shopify/livedata-ktx/releases/tag/v2.0.2.
So, migrating to v3 is an optional.
from livedata-ktx.
Let us know if you have any other concerns. I will close this issue for now. Feel free to reopen if needed.
from livedata-ktx.
Related Issues (13)
- NonNull operation doesn't preserve immutability of LiveData HOT 1
- Supertypes of the following classes cannot be resolved. HOT 6
- Incompatible with LiveData 2.x as package name is changed HOT 1
- remove @Suppress("DEPRECATION") HOT 3
- SingleLiveData doesn't work as expected HOT 4
- MutableLiveDataKtx is not subtype of MutableLiveData HOT 2
- Multiple implementation issue in android studio 3.5 HOT 2
- PublishLiveDataKtx not remove observer by lifecycle event
- debounce() uses Handler which makes it difficult to test
- Unnecessary Nullable types HOT 5
- minSdk version 19 -> 16? HOT 3
- Create `combineWith` operator
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from livedata-ktx.