Skip to content

OPiece/utils

Repository files navigation

opiece-utils

some common methods

Install

$ npm install opiece-utils --save

Usage

// import xyz from opiece-utils/lib/xyz

// list2tree
import list2tree from 'opiece-utils/lib/list2tree'

// request
import request from 'opiece-utils/lib/request'

example

import request from 'opiece-utils/lib/request'

request(`${url}`, {
  body: {
    ...
  },
  interceptors: {
    request: [interceptor, ...],
    response: [interceptor, ...]
  }
}).then(data => {
  console.log(data)
}).catch(err => {
  console.error(err)
})

LICENSE

MIT

Releases

No releases published

Packages

No packages published