Promise-based Ajax Wrapper with Simple Configurations
JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
dist
lib
test
.eslintrc
.flowconfig
.gitignore
.npmignore
README.md
karma.conf.js
package.json
webpack.config.js

README.md

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';