reduxkotlin-reselect

Redux reselect implementation for Redux-Kotlin. Mulitiplatform supported.

License

License

Categories

Categories

JavaScript Languages Kotlin
GroupId

GroupId

org.reduxkotlin
ArtifactId

ArtifactId

reselect-js
Last Version

Last Version

0.5.5
Release Date

Release Date

Type

Type

pom
Description

Description

reduxkotlin-reselect
Redux reselect implementation for Redux-Kotlin. Mulitiplatform supported.
Project URL

Project URL

https://github.com/reduxkotlin/Reselect/
Source Code Management

Source Code Management

https://github.com/reduxkotlin/Reselect/

Download reselect-js

How to add to project

<!-- https://jarcasting.com/artifacts/org.reduxkotlin/reselect-js/ -->
<dependency>
    <groupId>org.reduxkotlin</groupId>
    <artifactId>reselect-js</artifactId>
    <version>0.5.5</version>
    <type>pom</type>
</dependency>
// https://jarcasting.com/artifacts/org.reduxkotlin/reselect-js/
implementation 'org.reduxkotlin:reselect-js:0.5.5'
// https://jarcasting.com/artifacts/org.reduxkotlin/reselect-js/
implementation ("org.reduxkotlin:reselect-js:0.5.5")
'org.reduxkotlin:reselect-js:pom:0.5.5'
<dependency org="org.reduxkotlin" name="reselect-js" rev="0.5.5">
  <artifact name="reselect-js" type="pom" />
</dependency>
@Grapes(
@Grab(group='org.reduxkotlin', module='reselect-js', version='0.5.5')
)
libraryDependencies += "org.reduxkotlin" % "reselect-js" % "0.5.5"
[org.reduxkotlin/reselect-js "0.5.5"]

Dependencies

compile (3)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-stdlib-js jar 1.4.0
org.jetbrains.kotlin : kotlin-stdlib-common jar 1.4.0
org.reduxkotlin : redux-kotlin-js jar 0.5.5

Project Modules

There are no modules declared in this project.

Reselect

CI

badge badge badge badge badge badge badge badge

A Redux Reselect implementation for memoized dispatch on state selectors. Forked from Reduks implementation.

Documentation to come.

Example usage:

Subscribe to a single substate:

//selecting a substate subscribes to changes.  Lambda block will be executed when there is 
//a change in value of `isLoading`
val subscriber: StoreSubscriber = store.select({ it.isLoading }) {
        loadingIndicator.visibility = if (store.state.isLoading) View.VISIBLE else View.GONE
    }

//invoking subcription unsubscribes.  Do this when appropriate for component lifecycle
subscriber()  

Subscribe to multiple substates:

val multiSubscription = store.selectors {
            select({ it.isLoading }) {
                loadingIndicator.visibility = if (store.state.isLoading) View.VISIBLE else View.GONE
            }
            select({ it.name }) {
                nameTextView.text = store.state.name
            }
        }

//unsubscribe when appropriate
multiSubscription()

How to add to project:

Requires Kotlin 1.4.0. Artifacts are hosted on maven central. For multiplatform, add the following to your shared module:

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

For JVM only:

  implementation "org.reduxkotlin:reselect-jvm:0.5.5"
org.reduxkotlin

Redux-Kotlin

Redux for Kotlin multiplatform

Versions

Version
0.5.5