reduxkotlin-reselect

Redux reselect implementation for Redux-Kotlin. Mulitiplatform supported.

License

License

Categories

Categories

Kotlin Languages
GroupId

GroupId

org.reduxkotlin
ArtifactId

ArtifactId

reselect
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

How to add to project

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

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

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