All Downloads are FREE. Search and download functionalities are using the official Maven repository.

main.react.redux.Helpers.kt Maven / Gradle / Ivy

package react.redux

import kotlinext.js.js
import react.HOC
import react.Props

fun  rConnect(
    options: (Options>.() -> Unit) = {},
): HOC, Props> {
    return connect>(
        undefined,
        undefined,
        undefined,
        js {
            getDisplayName = { name: String -> "RConnect($name)" }
            methodName = "rConnect"
            options(this)
        }.unsafeCast>>()
    )
}

fun  rConnect(
    mapStateToProps: P.(S, OP) -> Unit,
    options: (Options.() -> Unit) = {},
): HOC {
    return connect(
        { state: S, ownProps: OP ->
            js {
                mapStateToProps(this, state, ownProps)
            }.unsafeCast

() }, undefined, undefined, js { getDisplayName = { name: String -> "RConnect($name)" } methodName = "rConnect" options(this) }.unsafeCast>() ) } fun rConnect( mapDispatchToProps: P.((A) -> R, OP) -> Unit, options: (Options.() -> Unit) = {}, ): HOC { return connect( undefined, { dispatch, ownProps -> js { mapDispatchToProps(this, dispatch, ownProps) }.unsafeCast

() }, undefined, js { getDisplayName = { name: String -> "RConnect($name)" } methodName = "rConnect" options(this) }.unsafeCast>() ) } fun rConnect( mapStateToProps: SP.(S, OP) -> Unit, mapDispatchToProps: DP.((A) -> R, OP) -> Unit, options: (Options.() -> Unit) = {}, ): HOC { return connect( { state, ownProps -> js { mapStateToProps(this, state, ownProps) }.unsafeCast() }, { dispatch, ownProps -> js { mapDispatchToProps(this, dispatch, ownProps) }.unsafeCast() }, undefined, js { getDisplayName = { name: String -> "RConnect($name)" } methodName = "rConnect" options(this) }.unsafeCast>() ) } fun rConnect( mapStateToProps: SP.(S, OP) -> Unit, mapDispatchToProps: DP.((A) -> R, OP) -> Unit, mergeProps: P.(SP, DP, OP) -> Unit, options: (Options.() -> Unit) = {}, ): HOC { return connect( { state, ownProps -> js { mapStateToProps(this, state, ownProps) }.unsafeCast() }, { dispatch, ownProps -> js { mapDispatchToProps(this, dispatch, ownProps) }.unsafeCast() }, { stateProps, dispatchProps, ownProps -> js { mergeProps(this, stateProps, dispatchProps, ownProps) }.unsafeCast

() }, js { getDisplayName = { name: String -> "RConnect($name)" } methodName = "rConnect" options(this) }.unsafeCast>() ) }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy