Redux implementation for Kotlin (supports multiplatform JVM, native, JS, WASM)

Overview

Redux-Kotlin

CI

badge ![badge][badge-ios] badge badge badge badge badge badge badge

A redux standard for Kotlin that supports multiplatform projects.

Full documentation at http://reduxkotlin.org.

Misson Statement

Provide a standard redux implementation for Kotlin. In doing so will foster a ecosystem of middleware, store enhancers, & dev tools. These core values will guide descisions for the project:

  • core redux-kotlin will be a minimal implementation that other libraries can build upon
  • modular development (follow example of https://github.com/reduxjs)
  • support for all platforms supported by Kotlin multiplatform (JVM, iOS, Native, JS, WASM)
  • developed in open and enable discussion for all interested parties via open channels (slack, github, etc. TBD)
  • not owned by a individual or company

Redux in Kotlin, and in mobile in particular, may differ a bit from javascript. Many have found the basic pattern useful on Android & iOS leading to tens of opensource redux libraries in Kotlin, Java, and Swift, yet an ecosystem has yet to emerge. A port of javascript redux is a good starting point for creating a standard and will aid in cross-pollination of middleware, store enhancers, & dev tools from the javascript world.

Redux has proven helpful for state management in mobile. A multiplatform Kotlin implementation & ecosystem will increase developer productivity and code reuse across platforms.

Droidcon NYC Slides Video TBA

*** PLEASE FILL OUT THE Redux on Mobile Survey ***

How to add to project:

Artifacts are hosted on maven central. They are published with gradle metadata, so you may need to enable with enableFeaturePreview("GRADLE_METADATA") in your settings.gradle file. For multiplatform, add the following to your shared module:

kotlin {
  sourceSets {
        commonMain { //   <---  name may vary on your project
            dependencies {
                implementation "org.reduxkotlin:redux-kotlin-threadsafe:0.5.5"
            }
        }
 }

For JVM only:

  implementation "org.reduxkotlin:redux-kotlin-threadsafe-jvm:0.5.5"

*Non threadsafe store is available. Typical usage will be with the threadsafe store. More info read here

Usage is very similar to JS Redux and those docs will be useful https://redux.js.org/. These docs are not an intro to Redux, and just documentation on Kotlin specific bits. For more info on Redux in general, check out https://redux.js.org/.

Create an AppState class

  data class AppState(val user: User, val feed: List<Feed>)

Create Reducers:

  val reducer: Reducer<AppState> =  { state, action ->
    when (action) {
        is UserLoggedInAction -> state.copy(user = action.user)
        ...
    }
  }

Create Middleware: There are a few ways to create middleware:

Using a curried function stored in a val/var:

  val loggingMiddleware: Middleware = 
          { store ->
              { next ->
                  { action ->
                        //log here
                        next(action)
                   }
               }
            }

Using a function:

  fun loggingMiddleware(store: Store) = { next: Dispatcher -> 
              { action: Any -> 
                     //log here
                     next(action)
               }

Using the convenience helper function middleware:

   val loggingMiddleware = middleware { store, next, action -> 
          //log here
          next(action)
          }

Create a store

  val store = createThreadSafeStore(reducer, AppState(user, listOf()), applyMiddleware(loggingMiddleware))

You then will have access to dispatch and subscribe functions from the store.

Communication

Want to give feedback, contribute, or ask questions?

#redux slack channel in kotlinlang

Trello boards - https://trello.com/reduxkotlinorg

Or create an issue on github.

Issues
  • Consider removing same-thread-enforcement from getState

    Consider removing same-thread-enforcement from getState

    Reading the state is often needed from multiple threads. Consideration of removing, or making optional, the same-thread-enforcement from the getState function to allow more flexibility in reading the state from the store. Calling from another thread will cause the check for isDispatching to fail if accessed while an action is dispatching. A solution that is needed that accounts allowing access from another thread, and respects actions that are currently being dispatched.

    Sample senario: Android webview javascript interface calls methods from a thread pool. A common usecase is to return a token from the state. If main thread is being used for the store, then use must write code to get the token from the main thread in a blocking manner.

    opened by patjackson52 10
  • Unit-Testing with Coroutines results in

    Unit-Testing with Coroutines results in "You may not call the store from a thread other than the thread on which it was created"

    Hi,

    we currently use your library in combination with Kotlin Coroutines and Flow. One of our middleware methods looks like this:

    private fun agbLoad(store: Store<AppState>, action: AgbLoad, next: Dispatcher) {
            CoroutineScope(Main).launch {
                flow { emit(apiService.client().user().api().termsOfUse()) }
                        .flowOn(IO)
                        // flowOn only works upstream.
                        // Catch & Collect are executed on the main thread
                        .catch { e ->
                            e.printStackTrace()
                            store.dispatch(AgbLoadFailure(e))
                        }
                        .collect { agb -> store.dispatch(AgbLoadSuccess(LegalState.Agb(agb.text, agb.activeFrom.ddMMYYYY()))) }
            }
    
            next(action)
        }
    

    We wanted to test this (and the other functions) and wrote the following JUnit Test:

        fun setUp() {
            Dispatchers.setMain(mainThreadSurrogate)
            recorderMiddleware = RecorderMiddleware()
            legalMiddleware = LegalMiddleware(apiService(), assetFeatureMock, userServiceMock)
        }
        @Test
        fun agbLoad_dispatchesAgbLoadSuccess() {
            webServer().setDispatcher(object : Dispatcher() {
                override fun dispatch(request: RecordedRequest?): MockResponse {
                    return MockResponse().setResponseCode(HttpURLConnection.HTTP_OK).setBody(termsOfUseResponseJson())
                }
            })
    
            runBlocking {
                CoroutineScope(Main).launch {
                    val store = createStore(appReducer, AppState(), applyMiddleware(
                            recorderMiddleware.all, LegalMiddleware(apiService(), assetFeatureMock, userServiceMock).all
                    ))
    
                    store.dispatch(AgbLoad())
                }
            }
    
            Barrier.awaitUntil { recorderMiddleware.getRecordings().size == 2 }
            assertThat(recorderMiddleware.getRecordings().last(), instanceOf(AgbLoadSuccess::class.java))
        }
    
        @After
        fun tearDown() {
            Dispatchers.resetMain() // reset main dispatcher to the original Main dispatcher
            mainThreadSurrogate.close()
        }
    

    Unfortunately the test throws an error: Exception in thread "UI @coroutine#3" java.lang.IllegalStateException: You may not call the store from a thread other than the thread on which it was created. This includes: getState(), dispatch(), subscribe(), and replaceReducer() This store was created on: 'UI @coroutine#2' and current thread is 'UI @coroutine#3' at org.reduxkotlin.CreateStoreKt$createStore$3.invoke(CreateStore.kt:50) at org.reduxkotlin.CreateStoreKt$createStore$7.invoke(CreateStore.kt:174)

    I already tried lots of coroutine combinations to get rid of this issue, but no success. Do you have an idea how we can fix this?

    (additional information): The exception doesn't appear in production, only in the test scenario.

    Thanks for your help :)

    opened by jennymolske 8
  • Execution failed for task compileKotlinJs

    Execution failed for task compileKotlinJs

    Hi, I'm trying to develop a sample-app using kotlin multiplatform and redux-kotlin but I'm struggling to setup the library for a new multiplatform project. I've created a "Kotlin/Multiplatform" project from IntelliJ 2019.3.2

    This is my gradle file:

    plugins {
        id 'java'
        id 'org.jetbrains.kotlin.multiplatform' version '1.3.61'
    }
    group 'com.shadowings'
    version '1.0.0'
    sourceCompatibility = 1.8
    repositories {
        mavenCentral()
    }
    dependencies {
        testCompile group: 'junit', name: 'junit', version: '4.12'
    }
    kotlin {
        jvm()
        js()
        iosArm64("ios") {
            binaries {
                framework()
            }
        }
        iosX64("iosSim") {
            binaries {
                framework()
            }
        }
        sourceSets {
            commonMain {
                dependencies {
                    implementation kotlin('stdlib-common')
                    implementation kotlin("org.reduxkotlin:redux-kotlin:0.4.0")
                }
            }
            commonTest {
                dependencies {
                    implementation kotlin('test-common')
                    implementation kotlin('test-annotations-common')
                }
            }
            jvmMain {
                dependencies {
                    implementation kotlin('stdlib-jdk8')
                }
            }
            jvmTest {
                dependencies {
                    implementation kotlin('test')
                    implementation kotlin('test-junit')
                }
            }
            jsMain {
                dependencies {
                    implementation kotlin('stdlib-js')
                }
            }
            jsTest {
                dependencies {
                    implementation kotlin('test-js')
                }
            }
            iosSimMain.dependsOn iosMain
            iosSimTest.dependsOn iosTest
        }
    }
    

    And I have this error when I try to build:

    Execution failed for task ':compileKotlinJs'.
    - Could not resolve all files for configuration ':jsCompileClasspath'.
       - Could not find org.jetbrains.kotlin:kotlin-org.reduxkotlin:redux-kotlin.
         Searched in the following locations:
           - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-org.reduxkotlin/redux-kotlin/kotlin-org.reduxkotlin-redux-kotlin.module
           - https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-org.reduxkotlin/redux-kotlin/kotlin-org.reduxkotlin-redux-kotlin.pom
         Required by:
             project :
    
    Possible solution:
     - Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
    

    You can find the whole project at this repository: https://github.com/EmmanueleVilla/themoviedb-kotlinmultiplatform

    bug 
    opened by EmmanueleVilla 5
  • WIP: Migrate to Kotlin Gradle DSL

    WIP: Migrate to Kotlin Gradle DSL

    The Kotlin Gradle DSL has groovy interoperability so it can be mixed and match with groovy. Therefore this PR can be merged as is, cuz the Android example is done, but ideally, the whole project should be converted.

    https://docs.gradle.org/5.6.1/userguide/kotlin_dsl.html#sec:kotlin-dsl_plugin

    @patjackson52

    opened by AOrobator 3
  • Publish for mingwX64

    Publish for mingwX64

    Currently lib fails to resolve for mingwX64 target. This essentially means it's unviable for any MPP project using it.

    opened by mpetuska 2
  • Empty artifact in maven central (?)

    Empty artifact in maven central (?)

    Hi,

    I have tried to download and use your library in my test multiplatform project. I have added your dependency in my build.gradle.kts like follow:

        sourceSets {
            commonMain {
                dependencies {
                    api("org.jetbrains.kotlin:kotlin-stdlib-common")
                    api("org.reduxkotlin:redux-kotlin:0.2.4")
                }
            }
       }
    

    However, I am still unable to use it on in my code - references to APIs functions cannot be found. Any ideas?

    opened by dudududi 2
  • Not compatible with Android Project

    Not compatible with Android Project

    I have added the following in build.gradle but import org.reduxkotlin.createStore is failing.

    dependencies { implementation "org.reduxkotlin:redux-kotlin:0.4.0" ... }

    question 
    opened by p21asthana 2
  • Unsubscribe StoreSubscription

    Unsubscribe StoreSubscription

    Currently, when subscribing to the store, a StoreSubscription is returned, but it's just an alias to () -> Unit. Subscriptions should be stored so they could be unsubscribed, otherwise it could lead to memory leaks.

    opened by Pyeroh 2
  • WIP: Migrate to Kotlin Gradle DSL

    WIP: Migrate to Kotlin Gradle DSL

    Continuation of https://github.com/reduxkotlin/redux-kotlin/pull/16

    Renamed branch so tests could run.

    opened by AOrobator 2
  • Kotlin 1.4.0-rc

    Kotlin 1.4.0-rc

    opened by mpetuska 1
  • Bump prismjs from 1.23.0 to 1.24.0 in /website

    Bump prismjs from 1.23.0 to 1.24.0 in /website

    Bumps prismjs from 1.23.0 to 1.24.0.

    Release notes

    Sourced from prismjs's releases.

    v1.24.0

    Release 1.24.0

    Changelog

    Sourced from prismjs's changelog.

    1.24.0 (2021-06-27)

    New components

    Updated components

    ... (truncated)

    Commits
    Maintainer changes

    This version was pushed to npm by rundevelopment, a new releaser for prismjs since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump set-getter from 0.1.0 to 0.1.1 in /website

    Bump set-getter from 0.1.0 to 0.1.1 in /website

    Bumps set-getter from 0.1.0 to 0.1.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump striptags from 3.1.1 to 3.2.0 in /website

    Bump striptags from 3.1.1 to 3.2.0 in /website

    Bumps striptags from 3.1.1 to 3.2.0.

    Release notes

    Sourced from striptags's releases.

    v3.2.0

    This release fixes a potential type confusion vulnerability when passing in a non-string argument to the function.

    Commits
    • f252a6b Merge pull request from GHSA-qxg5-2qff-p49r
    • 2719515 fix: throw TypeError if 'html' is non-string argument
    • 27a5dd9 Update README.md example output
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump postcss from 7.0.17 to 7.0.36 in /website

    Bump postcss from 7.0.17 to 7.0.36 in /website

    Bumps postcss from 7.0.17 to 7.0.36.

    Release notes

    Sourced from postcss's releases.

    7.0.36

    • Backport ReDoS vulnerabilities from PostCSS 8.

    7.0.35

    7.0.34

    • Fix compatibility with postcss-scss 2.

    7.0.33

    • Add error message for PostCSS 8 plugins.

    7.0.32

    7.0.31

    • Use only the latest source map annotation (by @​emzoumpo).

    7.0.30

    • Fix TypeScript definition (by @​nex3)

    7.0.29

    • Update Processor#version.

    7.0.28

    • Fix TypeScript definition (by @​nex3).

    7.0.27

    • Fix TypeScript definition (by @​nex3).

    7.0.26

    • Fix TypeScript definition (by @​nex3)

    7.0.25

    • Fix absolute path support for Windows (by @​tomrav)

    7.0.24

    7.0.23

    • Update Processor#version.

    7.0.22

    • Add funding link for npm fund.

    7.0.21

    • Revert passing nodes property to node constructor.

    7.0.20

    • Allow to pass PostCSS’s nodes in nodes property to node constructor.

    ... (truncated)

    Changelog

    Sourced from postcss's changelog.

    7.0.36

    • Backport ReDoS vulnerabilities from PostCSS 8.

    7.0.35

    • Add migration guide link to PostCSS 8 error text.

    7.0.34

    • Fix compatibility with postcss-scss 2.

    7.0.33

    • Add error message for PostCSS 8 plugins.

    7.0.36

    • Backport ReDoS vulnerabilities from PostCSS 8.

    7.0.35

    • Add migration guide link to PostCSS 8 error text.

    7.0.34

    • Fix compatibility with postcss-scss 2.

    7.0.33

    • Add error message for PostCSS 8 plugins.

    7.0.32

    7.0.31

    • Use only the latest source map annotation (by Emmanouil Zoumpoulakis).

    7.0.30

    • Fix TypeScript definition (by Natalie Weizenbaum).

    7.0.29

    • Update Processor#version.

    7.0.28

    • Fix TypeScript definition (by Natalie Weizenbaum).

    7.0.27

    • Fix TypeScript definition (by Natalie Weizenbaum).

    7.0.26

    • Fix TypeScript definition (by Natalie Weizenbaum).

    7.0.25

    • Fix absolute path support for Windows (by Tom Raviv).

    7.0.24

    • Fix TypeScript definition (by Keith Cirkel).

    ... (truncated)

    Commits
    • 67e3d7b Release 7.0.36 version
    • 54cbf3c Backport ReDoS vulnerabilities from PostCSS 8
    • 12832f3 Release 7.0.35 version
    • 4455ef6 Use OpenCollective in funding
    • e867c79 Add migration guide to PostCSS 8 error
    • 32a22a9 Release 7.0.34 version
    • 2293982 Lock build targets
    • 2c3a111 Release 7.0.33 version
    • 4105f21 Use yaspeller instead of yaspeller-ci
    • c8d02a0 Revert yaspeller-ci removal
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump hosted-git-info from 2.8.4 to 2.8.9 in /website

    Bump hosted-git-info from 2.8.4 to 2.8.9 in /website

    Bumps hosted-git-info from 2.8.4 to 2.8.9.

    Changelog

    Sourced from hosted-git-info's changelog.

    2.8.9 (2021-04-07)

    Bug Fixes

    2.8.8 (2020-02-29)

    Bug Fixes

    • #61 & #65 addressing issues w/ url.URL implmentation which regressed node 6 support (5038b18), closes #66

    2.8.7 (2020-02-26)

    Bug Fixes

    • Do not attempt to use url.URL when unavailable (2d0bb66), closes #61 #62
    • Do not pass scp-style URLs to the WhatWG url.URL (f2cdfcf), closes #60

    2.8.6 (2020-02-25)

    2.8.5 (2019-10-07)

    Bug Fixes

    • updated pathmatch for gitlab (e8325b5), closes #51
    • updated pathmatch for gitlab (ffe056f)

    Commits
    • 8d4b369 chore(release): 2.8.9
    • 29adfe5 fix: backport regex fix from #76
    • afeaefd chore(release): 2.8.8
    • 5038b18 fix: #61 & #65 addressing issues w/ url.URL implmentation which regressed nod...
    • 7440afa chore(release): 2.8.7
    • 2d0bb66 fix: Do not attempt to use url.URL when unavailable
    • f2cdfcf fix: Do not pass scp-style URLs to the WhatWG url.URL
    • e1b83df chore(release): 2.8.6
    • ff259a6 Ensure passwords in hosted Git URLs are correctly escaped
    • 624fd6f chore(release): 2.8.5
    • Additional commits viewable in compare view
    Maintainer changes

    This version was pushed to npm by nlf, a new releaser for hosted-git-info since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump lodash from 4.17.19 to 4.17.21 in /website

    Bump lodash from 4.17.19 to 4.17.21 in /website

    Bumps lodash from 4.17.19 to 4.17.21.

    Commits
    • f299b52 Bump to v4.17.21
    • c4847eb Improve performance of toNumber, trim and trimEnd on large input strings
    • 3469357 Prevent command injection through _.template's variable option
    • ded9bc6 Bump to v4.17.20.
    • 63150ef Documentation fixes.
    • 00f0f62 test.js: Remove trailing comma.
    • 846e434 Temporarily use a custom fork of lodash-cli.
    • 5d046f3 Re-enable Travis tests on 4.17 branch.
    • aa816b3 Remove /npm-package.
    • See full diff in compare view
    Maintainer changes

    This version was pushed to npm by bnjmnt4n, a new releaser for lodash since your current version.


    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Bump url-parse from 1.4.7 to 1.5.1 in /website

    Bump url-parse from 1.4.7 to 1.5.1 in /website

    Bumps url-parse from 1.4.7 to 1.5.1.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 0
  • Jenn/threadsafe enhancer

    Jenn/threadsafe enhancer

    Following up on issue https://github.com/reduxkotlin/redux-kotlin/issues/77, this PR creates a new enhancer called synchronizeStore that wraps a Redux store in a synchronization object.

    I wrote a couple tests to compare the original thread-safe store implementation that we were working with against the proposed method of using the synchronizeStore enhancer. The test involves thunk middleware as well as delays to mimic async thunks, and the test for the original implementation intermittently fails with the same error we were seeing in our setup. Notably, when using a breakpoint on line 105 of the CreateThreadSafeStoreSpec file and running the test for the original implementation in debug mode, I see that we step into the interface defs of the original store methods in CreateStore; doing the same with the test for the enhancer implementation sees us step into the interface defs of the synchronized store in SynchronizedStore. This suggests to me that with the original implementation, thunks might be accessing the unsynchronized store dispatch method.

    The failing test was written just for communicating the issue we were seeing, happy to remove this and/or change up the tests as you see fit. This is my first time contributing to this repo so please let me know if I missed anything in terms of contributing standards. Thanks!

    opened by jennkao 0
  • Threading issues even with createThreadSafeStore

    Threading issues even with createThreadSafeStore

    Hi there! Recently began using this library, and have noticed some hard-to-reproduce errors popping up while developing. The errors occur inconsistently and mention threading issues:

    You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://www.reduxkotlin.org/api/store#subscribelistener-storesubscriber for more details. You may be seeing this due accessing the store from multiplethreads. Try createThreadSafeStore() https://reduxkotlin.org/introduction/threading
    

    and

    You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store. You may be accessing getState while dispatching from another thread. Try createThreadSafeStore(). https://reduxkotlin.org/introduction/threading
    

    However we do use createThreadSafeStore, and these errors are being thrown from code outside our reducers (in thunks and views), so I am surprised to see these errors.

    We are using:

    org.reduxkotlin:redux-kotlin-threadsafe:0.5.5
    org.reduxkotlin:reselect:0.5.5
    org.reduxkotlin:redux-kotlin-thunk:0.5.5
    
    opened by zackls 5
Releases(v0.5.5)
  • v0.5.5(Aug 17, 2020)

  • v0.5.3(Jul 6, 2020)

  • v0.5.1(Jun 13, 2020)

    Thread-safe store introduced with createThreadSafeStore. This is available in a new dependency - org.reduxkotlin:redux-kotlin-threadsafe. Details available in the docs: https://www.reduxkotlin.org/introduction/getting-started https://www.reduxkotlin.org/introduction/threading

    Source code(tar.gz)
    Source code(zip)
Owner
Redux-Kotlin
Redux for Kotlin multiplatform
Redux-Kotlin
Unidirectional Data Flow in Kotlin - Port of https://github.com/ReSwift/ReSwift to Kotlin

ReKotlin Port of ReSwift to Kotlin, which corresponds to ReSwift/4.0.0 Introduction ReKotlin is a Redux-like implementation of the unidirectional data

null 475 Jul 29, 2021
Kotlin Multiplatform Router for Android and iOS

A powerful Kotlin Multiplatform Router for Android and iOS Support I am happy to help you with any problem on gitter Feel free to open any new issue!

Sebastian Sellmair 336 Jun 24, 2021
Extendable MVI framework for Kotlin Multiplatform with powerful debugging tools (logging and time travel), inspired by Badoo MVICore library

Should you have any questions or ideas please welcome to the Slack channel: #mvikotlin Inspiration This project is inspired by Badoo MVICore library.

Arkadii Ivanov 614 Aug 1, 2021
Model-View-ViewModel architecture components for mobile (android & ios) Kotlin Multiplatform development

Mobile Kotlin Model-View-ViewModel architecture components This is a Kotlin Multiplatform library that provides architecture components of Model-View-

IceRock Development 385 Jul 29, 2021
Nucleus is an Android library, which utilizes the Model-View-Presenter pattern to properly connect background tasks with visual parts of an application.

Nucleus Deprecation notice Nucleus is not under develpment anymore. It turns out that Redux architecture scales way better than MVP/MVI/MVVM/MVxxx and

Konstantin Mikheev 2k Jul 16, 2021
MVU for Kotlin Multiplatform

Oolong Oolong is an Elm inspired Model-View-Update (MVU) implementation for Kotlin multiplatform. As the name implies, three core concepts comprise th

Oolong 259 Jul 30, 2021
A Model-View-Presenter / Model-View-Intent library for modern Android apps

Mosby A Model-View-Presenter and Model-View-Intent library for Android apps. Dependency dependencies { compile 'com.hannesdorfmann.mosby3:mvi:3.1.1

Hannes Dorfmann 5.5k Jul 25, 2021
BaseDemo 是Android MVVM + Retrofit + OkHttp + Coroutine 协程 + 组件化架构的Android应用开发规范化架构

BaseDemo 是Android MVVM + Retrofit + OkHttp + Coroutine 协程 + 组件化架构的Android应用开发规范化架构,通过不断的升级迭代,目前主要分为两个版本,分别为分支 MVVM+Databinding 组件化版本,分支MVVM+Databinding+Single 单体版本。旨在帮助您快速构建属于自己的APP项目架构,做到快速响应上手,另外再长期的实践经验中汇总了大量的使用工具类,主要放在了项目 `lib_common` 组件中,以供大家参考使用。具体使用请开发者工具自己项目需求决定选择如何使用。

Huan Zhou 35 Jul 22, 2021
A sample project in Kotlin to demonstrate AndroidX, MVVM, Coroutines, Hilt, Room, Data Binding, View Binding, Retrofit, Moshi, Leak Canary and Repository pattern.

This repository contains a sample project in Kotlin to demonstrate AndroidX, MVVM, Coroutines, Hilt, Room, Data Binding, View Binding, Retrofit, Moshi, Leak Canary and Repository pattern

Areg Petrosyan 5 May 24, 2021
A full-featured framework that allows building android applications following the principles of Clean Architecture.

EasyMVP A powerful, and very simple MVP library with annotation processing and bytecode weaving. EasyMVP eliminates the boilerplate code for dealing w

null 1.3k Jul 21, 2021
Moxy is MVP library for Android

Moxy This Moxy repository is deprecated and no longer supported. Please migrate to the actual version of the Moxy framework at Moxy communuty repo. De

Arello Mobile 1.6k Jul 25, 2021
MVVM RECIPE ANDROID APP Is an app where I show how to use MVVM, retrofit, dagger hilt, coroutine, liveData, Kotlin, navigation component, and so on...

MVVM RECIPE ANDROID APP Is an app where I show how to use MVVM, retrofit, dagger hilt, coroutine, liveData, kotlin, navigation component, and so on...

Isaias Cuvula 6 Jul 7, 2021
Repository that showcases 3 Android app architectures: "Standard Android", MVP and MVVM. The exact same app is built 3 times following the different patterns.

Archi This repository showcases and compares different architectural patterns that can be used to build Android apps. The exact same sample app is bui

Iván Carballo 3.4k Jul 26, 2021