question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use pending GET request

See original GitHub issue

An idea for an enhancement to throttle or cache adapters as a flag usePendingRequest.

If there is a pending [similar] request, then the call returns a promise which will resolve the same as the current request.

An example of this need can be in a framework like React or Angular where a UserName component is mounted in 2 separate DOM locations and they both make the request to fetch user data. If they both mount within milliseconds, neither will see a cached request and start a new request. This feature would reduce simultaneous “like” requests in this situation by returning a promise for the first request made.

I’m happy to contribute this effort, please advise 😃

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
kuitoscommented, Nov 27, 2018

check the cacheAdapterEnhancer part😀 https://github.com/kuitos/axios-extensions#basic-usage

0reactions
crobinson42commented, Nov 27, 2018

That was taken from the example on the README.md of this repository.

On Nov 27, 2018, at 9:11 AM, Kuitos notifications@github.com wrote:

@crobinson42 https://github.com/crobinson42 You should not combine the throttleAdapterEnhancer with cachedAdapterEnhancer while you wanna manual control the cache of request, just use cachedAdapterEnhancer:

adapter: cacheAdapterEnhancer(axios.defaults.adapter) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kuitos/axios-extensions/issues/39#issuecomment-442139894, or mute the thread https://github.com/notifications/unsubscribe-auth/AFsmSxE4H8lX5kTV521FWrghiTrMiNzPks5uzXI7gaJpZM4YYB2r.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does "pending" mean for request in Chrome Developer ...
The Network pending state on time, means your request is in progressing state. As soon as it responds the time ...
Read more >
chrome requests get stuck pending - nginx - Server Fault
Open the network debugger in Chrome and try to reproduce a stuck request. It will show you an exact timeline: when the request...
Read more >
Get pending PAM requests | Microsoft Learn
Using the PAM REST API GET command to list pending requests.
Read more >
Angular HTTP Pending Request Pattern - Cory Rylan
Learn how to display HTTP request status messages to users using RxJS Observables. ... This pattern I call the pending request pattern.
Read more >
How to Cancel Pending API Requests to Show Correct Data
Turns out there is a way to abort pending DOM asynchronous requests using an AbortController . You can use it to cancel not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found