Skip to content

Interceptors documentation is wrong #992

@mathieusaade

Description

@mathieusaade

Hi

In you current documentation regarding Other interceptors at https://axios-cache-interceptor.js.org/guide/interceptors#explanation you said

TL;DR

  • Request interceptors registered before setupCache() are ran before and registrations made after are ran after.
  • Response interceptors registered before setupCache() are ran after and registrations made after are ran before.

Explanation

Axios interceptors are ran differently for the request and response ones.

  • Request interceptors are FILO (First In Last Out)
  • Response interceptors are FIFO (First In First Out)

As explained better in the Axios documentation and in this issue.

But in the issue #449 you test code shows the real order of interceptors execution:

  • Request interceptors are executed in the reverse order they were added
  • Response interceptors are executed in the order they were added

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions