Open marukami opened 4 years ago
Update: Had a bit more time to work on this. There are a few things that I think would be needed here.
Since DataStore keeps everything in a single protobuf encoded byte array if the store changes… yer, it all falls apart. Encryption fails as the protobuff encode/decode will fail to work now after say adding a new field. So, my thinking is to try wrapping the user protobuf with a decorator proto to track meta-data. One issue with that idea is that this might need to take a hard dependency on a specific protobuf implementation.
@patrickfav To make DataStore work as a separate module some package-private classes need to be made public, so, would it make sense to pull all the common code into a Core module?
This is an initial attempt to integrate with Jetpack DataStore
This is very much a first draft. As I'm still trying to work out how and what is needed to have min changeset to have both
SharedPreferences
andDataStore
Would moving the shared logic into a Core module make it easier to support either or both
SharedPreferences
andDataStore
?Feedback is very much welcome.
NOTE Kotlin is required as DataStore takes a hard dependency on Kotlin coroutines.
Follows #53