The pending action will be modified and a newly created promise handler
will be returned.
This has (suddenly?) caused errors in tests because the catch() handlers defined in tests would be called before the one defined in PromiseMiddleware:
const p = new Promise(...)
const {payload} = store.dispatch({
payload: new Promise(...),
type: '...',
})
try {
await payload
} catch (err) {
// this handler would be invoked before the catch handler in
// PromiseMiddleware
}
since the PromiseMiddleware adds a then-callback, followed by a
catch-callback.