Closed ljx213101212 closed 3 years ago
I propose to add
return (next: any) => (action: any) => {
if (typeof action === 'function') {
return action(store.dispatch, store.getState, config);
}
...
from https://github.com/jk-gan/redux-flipper/blob/master/src/index.ts#L66 to handle when action is a function.
I propose to add
return (next: any) => (action: any) => { if (typeof action === 'function') { return action(store.dispatch, store.getState, config); } ...
from https://github.com/jk-gan/redux-flipper/blob/master/src/index.ts#L66 to handle when action is a function.
This will make a force return and skip the thunk middleware which breaks the thunk functionality. I think there is no issue for this redux-flipper middleware. Instead, the debugger should handle the case when action type
is unknown.
@jk-gan Is it a good idea to show thunk action in the debugger?
Hi, thanks for the suggestion. we just released version 2.0.0 and the issue should be fixed.
A similar issue can be reproduced by https://github.com/jk-gan/flipper-plugin-redux-debugger/issues/30
I realized that when I use redux-thunk in like below has an issue.
It could be createDebugger didn't handle when action is a function case? https://github.com/jk-gan/redux-flipper/blob/master/src/index.ts#L66