Code Monkey home page Code Monkey logo

Comments (7)

kuitos avatar kuitos commented on July 28, 2024 3

Maybe we should release 4.x version for this breaking change

from axios-extensions.

simllll avatar simllll commented on July 28, 2024 3

const defaultAdapter = axios.getAdapter('http');
or
const defaultAdapter = axios.getAdapter(axios.defaults.adapter);
works for me

from axios-extensions.

litchia avatar litchia commented on July 28, 2024 1

Maybe we should release 4.x version for this breaking change也许我们应该为这个突破性的变化发布4.x版本

Any progress on the new project?

from axios-extensions.

nabenzine avatar nabenzine commented on July 28, 2024

Maybe we should release 4.x version for this breaking change

It would be great !

from axios-extensions.

bilby91 avatar bilby91 commented on July 28, 2024

Is there a temporal workaround for this ?

from axios-extensions.

shrpne avatar shrpne commented on July 28, 2024

This works for me

import axios from 'axios';
import adapters from 'axios/lib/adapters/adapters.js';

const getAdapter = adapters.getAdapter;

/**
 * @return {import('axios').AxiosAdapter}
 */
export function getDefaultAdapter() {
    return getAdapter(axios.defaults.adapter);
}

from axios-extensions.

BryceBarbara avatar BryceBarbara commented on July 28, 2024

As it stands, there doesn't seem to be a valid typescript safe way to do this without some hand waving. It doesn't appear the axios library types any of its adapter files and doesn't provide a type-safe way of accessing them.

from axios-extensions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.