aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules
diff options
context:
space:
mode:
Diffstat (limited to 'kvision-modules')
-rw-r--r--kvision-modules/kvision-redux/src/main/kotlin/pl/treksoft/kvision/KVManagerRedux.kt8
1 files changed, 7 insertions, 1 deletions
diff --git a/kvision-modules/kvision-redux/src/main/kotlin/pl/treksoft/kvision/KVManagerRedux.kt b/kvision-modules/kvision-redux/src/main/kotlin/pl/treksoft/kvision/KVManagerRedux.kt
index 4b51ff19..346f623d 100644
--- a/kvision-modules/kvision-redux/src/main/kotlin/pl/treksoft/kvision/KVManagerRedux.kt
+++ b/kvision-modules/kvision-redux/src/main/kotlin/pl/treksoft/kvision/KVManagerRedux.kt
@@ -26,6 +26,7 @@ import redux.Enhancer
import redux.Middleware
import redux.Reducer
import redux.Store
+import kotlin.browser.window
internal val kVManagerReduxInit = KVManagerRedux.init()
@@ -64,6 +65,11 @@ internal object KVManagerRedux {
@Suppress("UnsafeCastFromDynamic")
internal fun <A, T1, R> compose(function1: (T1) -> R, function2: (A) -> T1): (A) -> R {
- return redux.compose(function1, function2)
+ val composeEnhancers = if (window.asDynamic().__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ != undefined) {
+ window.asDynamic().__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
+ } else {
+ redux.compose
+ }
+ return composeEnhancers(function1, function2)
}
}