axios-last
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

axios-last

NPM version

Solution for taking the last value from multiple calls

Install

yarn

yarn add axios-last

npm

npm install --save axios-last

Import

ES2015

import { create } from 'axios-last'

CommonJS

const { create } = require('axios-last')

Usage

import { create } from 'axios-last'

const request = create()

for (let i = 0; i < 3; i++) {
  request({
    method: 'GET',
    url: 'https://test.com/users',
    params: {
      name: i
    }
  }).then(res => {
    // only request with name === 2 received
    // all previous requests were cancelled while subsequent made
  })
}

LICENSE

MIT License

Readme

Keywords

Package Sidebar

Install

npm i axios-last

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

7.37 kB

Total Files

7

Last publish

Collaborators

  • howard.zuo