0.2.0 • Published 4 months ago

@xirang/request v0.2.0

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

request

A simple axios wrapper for better async data fetching

Usage

import request, { createService, createServices } from '@xirang/request';

request

request(url, configs);

request.get(url, params, configs);

request.post(url, data, configs);

request config documentation: https://axios-http.com/docs/req_config

createService

const listAll = createService({
  url: '/api/listAll',
});

const list = await listAll(payload, configs);

createServices

const services = createServices({
  listAll: {
    url: '/api/listAll',
  },
});

const list = await services.listAll(payload, configs);
0.2.0

4 months ago

0.1.2

8 months ago

0.1.4

7 months ago

0.1.3

7 months ago

0.1.1

9 months ago

0.1.0

9 months ago