7.0.2 • Published 5 years ago

apiz-browser-client v7.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

apiz-browser-client

apiz-browser-client implements the APIzClient interface for browser, based on tinyjx, so you can use options of tinyjx.

Usage

import { APIz } from 'apiz-ng';
import apizClient from 'apiz-browser-client';

const apiMeta = {
    getBook: {
        url: 'http://www.a.com'
    }
};

const apis = new APIz(apiMeta, {
    client: apizClient({
        beforeSend(xhr) {
            return false;
        },
        afterResponse(resData, status, xhr, url, reqData) {
            console.log(resData);
        },
        complete(resData, xhr, url, reqData) {
            console.log(resData);
        },
        retry: 3
    })
});

apis.getBook().then(({data, next}) => {
    console.log(data);
    next();
})

beforeRequest and afterResponse are hooks of tinyjx.

7.0.2

5 years ago

7.0.1

5 years ago

7.0.0

5 years ago

6.0.1

5 years ago

6.0.0

5 years ago

5.0.0

5 years ago

4.1.5

5 years ago

4.1.4

5 years ago

4.1.3

5 years ago

4.1.2

5 years ago

4.1.1

5 years ago

4.1.0

5 years ago

4.0.0

5 years ago

2.0.1

5 years ago

2.0.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago