AndroidX DataStore 1.0.0-alpha07

1.0.0-alpha07
Added 1
  • A new SharedPreferencesMigration constructor allows injecting SharedPreferences, enabling migration from EncryptedSharedPreferences or direct boot SharedPreferences to DataStore.
Changed 2
Fixed 1
  • Cancellation behavior is fixed when the caller scope is cancelled.
Removed 1
  • The Context.createDataStore extension function has been removed and replaced with the globalDataStore property delegate, which should be called once at the top level of a Kotlin file so there is only one instance. inferred, marked in the notes below

1 change to check, marked in the notes below

From AndroidX DataStore

The Context.createDataStore extension function has been removed and replaced with globalDataStore property delegate. Call globalDataStore once at the top level in your kotlin file. For example: val Context . myDataStore by dataStore (...) Put this at the top level of your kotlin file so there is only one instance of it. ( I57215, b/173726702) The RxDataStore functions are now on an RxDataStore class instead of extension functions on DataStore. ( Idccdb, b/177691248) If you want to migrate EncryptedSharedPreferences (or direct boot SharedPreferences) to DataStore you can now do that with the new SharedPreferencesMigration constructor that allows you to inject the SharedPreferences. ( I8e04e, b/177278510) DataStore will now throw an exception if there are multiple active DataStores for the same file. If you were not managing your DataStore as a Singleton or were not ensuring that no two instances of DataStore are simultaneously active for a file then you may now see exceptions when reading or writing to DataStore. These can be fixed by managing your DataStore as a Singleton. ( Ib43f4, b/177691248) Fix cancellation behavior when caller scope is cancelled. ( I2c7b3) removed · inferred signature changed · inferred behavior changed · inferred

View original

Upgraded? How did it go?

Discussion