Rxkprefs Versions Save

🛠 A small Kotlin library to make shared preferences easy + RxJava and Coroutines support

2.0.1

4 years ago
  • Dependency upgrades.
  • Internal re-organization and cleanup.
  • AndroidX Preferences is used to retrieve default SharedPreferences, now, since the stock Context method is deprecated with API 29.
  • The library is now split into 3 modules: core, RxJava, and coroutines. This library is no longer RxJava-specific. See the README for details.

1.2.1

5 years ago

Enable multiple subscribers on the same Pref instance.

With this:

val myPref: Pref<Int> = // ...

myPref.observe().subscribe { println("One: $it") }
myPref.set("Hi")

myPref.observe().subscribe { println("Two: $it") }
myPref.set("Hello")

You'd get console output like this:

One: Hi
One: Hello
Two: Hello

1.2.0

5 years ago

RxkPrefs is now an interface, allowing this library to be more mockable in tests. You now must use the rxkPrefs function to retrieve an instance of this interface, rather than invoking a constructor.

1.1.0

5 years ago
  1. AndroidX is now stable, so upgraded to that. Also upgraded RxJava.
  2. Pref itself is now an Rx Consumer, so asConsumer() is redundant.
  3. Rename asObservable() to observe().

1.0.2

5 years ago
  1. Kotlin 1.2.70.
  2. Switch from support-annotations to the equivalent androidx package.

1.0.1

5 years ago
  1. Add getSharedPrefs() method in case you need access to the underlying SharedPreferences instance.
  2. Internal cleanup and fixes.

1.0.0

5 years ago

The initial release