Open aprofromindia opened 5 years ago
Thunk actions are asynchronous and therefore you won't immediately see the expected result in the state, but with a small delay. You might try a CallableThunkAction and then await MyCallableThunkAction().call(store)
instead of store.dispatch(...)
, but I haven't tried that. In case the thunk action dispatches more asynchronous actions, and you need to wait for them to be finished, that suggestion will surely not work.
I have written the following code and am trying to test a redux thunk action in flutter. Unfortunately when I debug the code, I can see the thunkMiddleware doesn't intercept the action as expected (as the returned
Function(store)
never gets triggered).state.dart
state_test.dart
Any help in fixing the test would be most appreciated!