@dewib/dw-api

2.7.0 • Public • Published

dw-ui

Dewib api wrap all your request into one place and map your response for your needs.

Install

Add package yarn add @dewib/dw-api

Usage

Add your main service into ./dewib/api folder

import UserService from './user/index'

export default {
  UserService
}

Then your service should look like

import { Model } from '@dewib/dw-api/utils'
/**
 *
 *
 * @export
 * @class UserService
 * @extends {Model}
 */
export default class UserService extends Model {
  /**
   * Create user
   * @param {*} user
   * @returns {Promise<*>} User model
   */
  store (user, params) {
    return this.$http...
  }
}

/@dewib/dw-api/

    Package Sidebar

    Install

    npm i @dewib/dw-api

    Weekly Downloads

    34

    Version

    2.7.0

    License

    MIT

    Unpacked Size

    14.4 kB

    Total Files

    11

    Last publish

    Collaborators

    • dewib