Skip to content

afeiship/next-ajax-promise

Repository files navigation

next-ajax-promise

Promise able for next ajax.

installation

npm install -S afeiship/next-ajax-promise --registry=https://registry.npm.taobao.org

apis

api params description
fetch inMethod, inUrl, inData, inOptions Send a request by XHR

usage

import NxAjaxPromise from 'next-ajax-promise';

// code goes here:
const res = NxAjaxPromise.fetch('get', 'https://api.github.com/users/afeiship', null,{ cancelable: true }).then(
  (response) => {
    console.log('response:->', response);
  }
);

// cancel:
res.destroy();

Releases

No releases published

Packages

No packages published