UNPKG

redux-api-middleware

Version:
36 lines (35 loc) 1.23 kB
/** * Redux middleware for calling an API * @module redux-api-middleware * @requires lodash.isplainobject * @exports {string} RSAA * @exports {function} isRSAA * @exports {function} validateRSAA * @exports {function} isValidRSAA * @exports {error} InvalidRSAA * @exports {error} InternalError * @exports {error} RequestError * @exports {error} ApiError * @exports {function} getJSON * @exports {function} createMiddleware * @exports {ReduxMiddleWare} apiMiddleware */ /** * @typedef {function} ReduxMiddleware * @param {object} store * @returns {ReduxNextHandler} * * @typedef {function} ReduxNextHandler * @param {function} next * @returns {ReduxActionHandler} * * @typedef {function} ReduxActionHandler * @param {object} action * @returns undefined */ import RSAA from './RSAA'; import { isRSAA, validateRSAA, isValidRSAA } from './validation'; import { InvalidRSAA, InternalError, RequestError, ApiError } from './errors'; import { createAction, getJSON } from './util'; import { apiMiddleware, createMiddleware } from './middleware'; export { RSAA, isRSAA, validateRSAA, isValidRSAA, InvalidRSAA, InternalError, RequestError, ApiError, getJSON, createAction, createMiddleware, apiMiddleware };