File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
lib/src/commonMain/kotlin/org/reduxkotlin Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -27,12 +27,13 @@ fun <State> createThunkMiddleware(extraArgument: Any? = null): ThunkMiddleware<S
2727 { next: Dispatcher ->
2828 { action: Any ->
2929 if (action is Function <* >) {
30- try {
31- (action as Thunk <* >)(store.dispatch, store.getState, extraArgument)
32- } catch (e: Exception ) {
33- throw IllegalArgumentException ()
34- // Logger.d("Dispatching functions must use type Thunk: " + e.message)
35- }
30+ @Suppress(" UNCHECKED_CAST" )
31+ val thunk = try {
32+ (action as Thunk <* >)
33+ } catch (e: ClassCastException ) {
34+ throw IllegalArgumentException (" Dispatching functions must use type Thunk:" , e)
35+ }
36+ thunk(store.dispatch, store.getState, extraArgument)
3637 } else {
3738 next(action)
3839 }
You can’t perform that action at this time.
0 commit comments