Skip to content

pablobaxter/rx-preferences

 
 

Repository files navigation

Rx Preferences

CircleCI GitHub Maven Central

A collection of libraries to allow SharedPreferences to be reactive

This library was created to continue improving on the great work that @f2prateek had done with rx-preferences.

In order to handle the varying number of reactive frameworks available, there are multiple libraries available, which all share the same basic APIs and adapters.

Available Reactive SharedPreferences Libraries

  • Core
    • implementation 'com.frybits.rx.preferences:core:1.1.0'
  • Coroutine/Flow
    • implementation 'com.frybits.rx.preferences:coroutine:1.1.0'
  • LiveData
    • implementation 'com.frybits.rx.preferences:livedata:1.1.0'
  • Rx2
    • implementation 'com.frybits.rx.preferences:rx2:1.1.0'
  • Rx3
    • implementation 'com.frybits.rx.preferences:rx3:1.1.0'

For ease of ensuring all libraries are compatible, as they may have varying release cadences, a BOM is also provided:

// Import BOM
implementation platform('com.frybits.rx.preferences:bom:1.1.0')
implementation 'com.frybits.rx.preferences:core'
implementation 'com.frybits.rx.preferences:livedata'

Migration from :rx-preferences to :rx2

Many of the APIs are similar to f2prateek/rx-preferences, however there were some changes to packages and class names, mainly due to the addition of the other reactive frameworks. This guide can be used for migrating from :rx-preferences to :rx2 library (and potentially even :rx3).

  1. Change Gradle dependency import from com.f2prateek.rx.preferences2:rx-preferences to com.frybits.rx.preferences:rx2
  2. Rename all com.f2prateek.rx.preferences2.Preference imports to com.frybits.rx.preferences.rx2.Rx2Preference
  3. Rename all Preferences class usages to Rx2Preference
  4. Rename all com.f2prateek.rx.preferences2.RxSharedPreferences imports to com.frybits.rx.preferences.rx2.Rx2SharedPreferences
  5. Rename all RxSharedPreferences class usages to Rx2SharedPreferences

All other API usages remain the same.

License

    Copyright 2014 Prateek Srivastava

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

About

Reactive SharedPreferences for Android

Resources

License

Stars

Watchers

Forks

Languages

  • Kotlin 100.0%