aboutsummaryrefslogtreecommitdiff
path: root/kvision-modules/kvision-redux/src
diff options
context:
space:
mode:
authorRobert Jaros <rjaros@finn.pl>2019-07-08 22:20:22 +0200
committerRobert Jaros <rjaros@finn.pl>2019-07-08 22:20:22 +0200
commitd32318661a3ed7ba71120cb6003abf50c18f85be (patch)
tree6cdf3d05ccef87e9fb2a13cd2c011e186fc33a5f /kvision-modules/kvision-redux/src
parentdd2413b5e900efee16b352b99d1370b9ed43735a (diff)
downloadkvision-d32318661a3ed7ba71120cb6003abf50c18f85be.tar.gz
kvision-d32318661a3ed7ba71120cb6003abf50c18f85be.tar.bz2
kvision-d32318661a3ed7ba71120cb6003abf50c18f85be.zip
Support for redux-devtools-extension
Diffstat (limited to 'kvision-modules/kvision-redux/src')
-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)
}
}