0.0.3 • Published 9 years ago

ajaxo v0.0.3

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

Ajaxo - A Simple Ajax Wrapper (WIP)

Ajaxo is a promise-based Ajax wrapper with simple configurations, built with modern JavaScript technology. More docs and examples is coming.

// api.js
import {APIBuilder} from 'ajaxo';

var definitions = {
    report: {
        url: '/report/<%= id %>',
        type: 'POST',
    }
};
export var API = APIBuilder(definitions);

// request-actions.js
API.report()
    .resolveWith({ id: 1 })
    .post()
    .then(response => {
        doSomethingWith(response);
    })
    .catch(xhr => {
        ...
    });

Import dist lib or ES2015 version

If you are willing to use pre-compiled ES2015 src directly, import from ajaxo/lib instead like:

import {APIBuilder} from 'ajaxo/lib/api';
0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago

0.0.0

9 years ago