Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afeiship/next-ajax-promise
Promise able for next ajax.
https://github.com/afeiship/next-ajax-promise
abort ajax destroy next promise
Last synced: 15 days ago
JSON representation
Promise able for next ajax.
- Host: GitHub
- URL: https://github.com/afeiship/next-ajax-promise
- Owner: afeiship
- License: mit
- Created: 2019-09-08T13:33:42.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-09-27T09:49:44.000Z (over 5 years ago)
- Last Synced: 2024-10-26T22:53:42.281Z (2 months ago)
- Topics: abort, ajax, destroy, next, promise
- Language: JavaScript
- Size: 12.7 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# next-ajax-promise
> Promise able for next ajax.## installation
```bash
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
```js
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();
```