0.2.1 • Published 1 year ago

@music163/request v0.2.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

request

A simple axios wrapper for better async data fetching

Usage

import request, { createService, createServices } from '@music163/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.1

1 year ago

0.2.0

1 year ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago