🚀Quick start

import chimuApi from 'chimu-api/dist/api.js'

Or use as module

import chimuApi from 'chimu-api/dist/api.mjs'

Example GET Request

const config = {
    baseURL: 'https://app.example.com',
};

const Api = new chimuApi(config);

export const GET_LIST = 'GET_LIST';
export const GET_LIST_SUCCESS = 'GET_LIST_SUCCESS';
export const GET_LIST_FAILURE = 'GET_LIST_FAILURE';

const getList = {
    type: GET_LIST,
    payload: {},
    params: {},
    meta: {
        method: 'get',
        path: '/list',
    },
};

Api.one(getList).then(resp => {
    if (resp.status === GET_OFFERS_SUCCESS) {
        console.log('Success', resp.data);
    }
    return resp.status;
});

Last updated