-
Notifications
You must be signed in to change notification settings - Fork 60
Switch AppDataStore to Java instead of Kotlin #418
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Switch AppDataStore to Java instead of Kotlin #418
Conversation
|
mmmh nice! will have a look |
|
|
||
| import io.reactivex.rxjava3.core.Single; | ||
|
|
||
| @OptIn(markerClass = kotlinx.coroutines.ExperimentalCoroutinesApi.class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the problem i had as well
not sure we should be deploying experimental api in production as its not recommended (they are unstable / still in dev mode)
Not sure if its as bad as it sounds though but i steered away
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
crazy part is that this java implementation is in googles official docs thats what confuses me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh i cant find java documentation anymore 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like I mentioned in your PR, I think the "experimental" part is not the really the datastore-preferences-rxjava3 library, itself, but that under the hood it is using Kotlin Coroutines which (at one point) were experimental). From Kotlin 1.3+, Coroutines are no longer experimental. I have not found any information as to why datastore-preferences-rxjava3 has not removed the annotation requirement, but everything I have read about coroutines suggests they are def "production ready".
Additionally, since your current approach also uses Kotlin coroutines (and calls them from Java), I cannot understand how they would not be tecnically makeing the same core operations that datastore-preferences-rxjava3 still has marked as "experimental".
At the end of the day, I am more comfortable with having this annotation than with trying to introduce Kotlin directly to the codebase.
| return new MutablePreferences(); | ||
| }); | ||
| dataStore = new RxPreferenceDataStoreBuilder(context, DATASTORE_NAME) | ||
| .setCorruptionHandler(corruptionHandler) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
was getting errors for this couldn't get it to work :)
No description provided.