Skip to content
No description, website, or topics provided.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
examples
src
.babelrc
.eslintrc
.gitignore
.npmignore
README.md
package.json
webpack.config.js

README.md

Request Api Adapter

Simple request api adapter for promise based HTTP clients


Installation

npm install --save request-api-adapter

or

yarn add request-api-adapter

Usage

import { createAdapter } from 'request-api-adapter';

const apiAdapter = createAdapter(
  client,
  baseConfig,
  {
    someRequest,
  },
  successHandler,
  errorHandler,
);

// ...

apiAdapter.someRequest(config).then(requestHandler);

Compose requests

import { compose } from 'request-api-adapter';

function complicatedRequest(config) {
  return compose(
    firstSimpleRequest,
    secondSimpleRequest,
  )(config);
}

API

createAdapter(client[, baseConfig[, request[, successHandler[, errorHandler]]]])
compose(request[, request[, ...]])

Credits

Sponsored by JetRockets.

JetRockets

You can’t perform that action at this time.