Coder Social home page Coder Social logo

Comments (7)

Flyrell avatar Flyrell commented on May 22, 2024 1

Hi @thomergil, thanks for submitting the issue.

Yes I'm aware that skipWhileRefreshing: false is required and I plan to change it as soon as possible in the v3 of the library.

Please, understand this is something I do in my free time while I'm working on other projects/libraries. If you'd like to fast-forward the development process, please consider contributing if that's something you'd be able to do. I'd be more than happy to do a code review & accept any pull requests on this package.

When it comes to the documentation, there's no return statement because of how the arrow functions work. When only one statement is executed and there's no wrapping curly braces {} the statement will be returned automatically. Although it's correct, I agree that the function can be written in {} and return the statement, so the people seeing it will actually realise that the return is necessary for the library to work.

from axios-auth-refresh.

Flyrell avatar Flyrell commented on May 22, 2024 1

I plan to include this change in v3.0.0 [PR #105].

from axios-auth-refresh.

SerhiyRomanov avatar SerhiyRomanov commented on May 22, 2024

I agree with @thomergil because I am faced with the same error. I resolved it only after reading this issue.

from axios-auth-refresh.

vinurs avatar vinurs commented on May 22, 2024

@SerhiyRomanov me too

from axios-auth-refresh.

Shaddix avatar Shaddix commented on May 22, 2024

I was a bit confused by the statement in the initial message:

Secondly, documentation is unclear. It needs to mention that refreshAuthLogic needs to return the axios instance:

It seems to me, that refreshAuthLogic should return Promise, not the axios instance (at least, that's what I got from the docs, and that's what I'm doing currently and it seems to work).

If my assumption is true, please confirm, that it's ok to return simple Promise from that method :)

from axios-auth-refresh.

Flyrell avatar Flyrell commented on May 22, 2024

@Shaddix yes, you're right. It's enough to return any Promise, which triggers the stalled requests to run once again.

I think what author meant was that the example in documentation uses an arrow function to return the axios call (not instance) and there's no return statement, which might be confusing for some people.

from axios-auth-refresh.

Flyrell avatar Flyrell commented on May 22, 2024

Done, merged and published in #111.

from axios-auth-refresh.

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.