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
27
27
{ next: Dispatcher ->
28
28
{ action: Any ->
29
29
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)
36
37
} else {
37
38
next(action)
38
39
}
You can’t perform that action at this time.
0 commit comments