Leland Richardson [G]

    3 years ago
    i also haven’t used the above library, but pretty much all redux-like libraries will be able to easily interop with compose. Looking at the readme, and targeting current Compose APIs (which are subject to change), you could easily interop with ReKotlin like so:
    // normal API to create a store based on readme example
    val mainStore = Store(
         reducer = ::counterReducer,
         state = null
    // effect-based API to select/subscribe to store in composition
    fun <TSlice, TState> Store<TState>.select(selector: (TState) -> TSlice) = effectOf<TSlice> {
      val result = +state { selector(state) }
      +onCommit(selector) {
        val observer = StoreSubscriber<TSlice> { result.value = it }
        subscribe(observer, selector)
        onDispose {
    // usage
    @Composable fun SomeView() {
      val count = { it.counter }
      Text("Count: $count")


    3 years ago
    I anticipate that one day we will have jetpack Redux :troll:

    Patrick Jackson

    3 years ago
    I've started in hopes of making a standard redux for kotlin. Just starting to look at integration with Compose, so this is helpful @Leland Richardson [G]. Redux pattern is simple to implement, but having an ecosystem would make it more powerful
    Just tried the above and works wonderfully with redux-kotlin. Thanks for making this extensible

    Antanas A.

    3 years ago
    noo, please, stop redux cancer spread