How to use the redux-api-middleware.isValidRSAA function in redux-api-middleware

To help you get started, we’ve selected a few redux-api-middleware examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Darmody / DoubanFMac / src / middlewares / apiMiddlewareHook.js View on Github external
export default store => next => action => {
  let newAction = action;

  if (isValidRSAA(action)) {
    newAction = pendingRefuse(action, store);
    if (!isValidRSAA(newAction)) return next(newAction);

    newAction = compose(
       pendingRefuse, stringifyJsonBody, serializeFormBody, decamelizeBody
    )(newAction);
  }

  return next(newAction);
};
github Darmody / DoubanFMac / src / middlewares / apiMiddlewareHook.js View on Github external
export default store => next => action => {
  let newAction = action;

  if (isValidRSAA(action)) {
    newAction = pendingRefuse(action, store);
    if (!isValidRSAA(newAction)) return next(newAction);

    newAction = compose(
       pendingRefuse, stringifyJsonBody, serializeFormBody, decamelizeBody
    )(newAction);
  }

  return next(newAction);
};