How to use the redux-api-middleware.CALL_API 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 vgno / redux-fetcher / test / index.js View on Github external
describe('behaviour', () => {
        const CALL_API = require('redux-api-middleware').CALL_API;
        const reduxFetcher = require('../src');

        describe('createFetchAction', () => {
            let validAction, validCamelAction;

            beforeEach(() => {
                validAction = reduxFetcher.createFetchAction('data', 'http://localhost/api')[CALL_API];
                validCamelAction = reduxFetcher.createFetchAction('dataCamelCase', 'http://localhost/api')[CALL_API];
            });

            afterEach(() => {
                validAction = null;
            });

            it('must throw if identifier is not provided', () => {
                (() => reduxFetcher.createFetchAction()).should.throw(Error);
github chungchi300 / redux-api-middleware-addon / lib / actions / index.js View on Github external
if (headers["Content-Type"] === "multipart/form-data") {
      delete headers["Content-Type"];
      delete headers["content-type"];
    }
    //
    var result = {
      endpoint: getState().api.protocol + "://" + getState().api.host + getState().api.basePath + realPath,
      method: method,

      headers: headers,
      body: body,
      types: (0, _api.processType)(types, pathName, method)
    };

    return dispatch((0, _defineProperty3.default)({}, _reduxApiMiddleware.CALL_API, result));
  };
}
github chungchi300 / redux-api-middleware-addon / lib / common / actions / index.js View on Github external
}

  if (headers["Content-Type"] === "multipart/form-data") {
    delete headers["Content-Type"];
    delete headers["content-type"];
  }
  //
  var result = {
    endpoint: getState().api.protocol + "://" + getState().api.host + getState().api.basePath + realPath,
    method: method,

    headers: headers,
    body: body,
    types: (0, _api.processType)(types, pathName, method)
  };
  return (0, _defineProperty3.default)({}, _reduxApiMiddleware.CALL_API, result);
}