Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
error: true
});
}
}
// We can now dispatch the request FSA
dispatch(requestType);
// get fake response
const res = getMockResponse(action);
await sleep(1000);
// Process the server response
if (res.ok) {
return next(await actionWith(
successType,
[action, getState(), res]
));
}
return next(await actionWith(
{
...failureType,
error: true
},
[action, getState(), res]
));
};
}