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.

Preferred XMLHttpRequest Module (remove superagent)

See original GitHub issue

We are looking to move away from using jQuery.ajax, and instead are looking at preferred modules to handle this instead.

Possibilities:

On the back of this, we could even create a Service class which can help create reusable endpoints and can take care of some of the boilerplate required in making requests.

For example (just a rough sketch), a customer service which has GET requests already set up:

CustomerService.getCustomer(3)
  .done((response) => {
    ...
  })
  .fail((response) => {
    ...
  });

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
SeanArmstrongcommented, Jul 11, 2016

Going forward Axios supports interceptors and promises by default.

0reactions
edleeks87commented, Dec 3, 2019

We are looking to move away from providing specific data-fetching and allowing developers the flexibility to choose their own

Read more comments on GitHub >

github_iconTop Results From Across the Web

[discuss] change how errors are handled · Issue #283 - GitHub
In that context, I personally would have preferred that superagent handles all HTTP status codes transparently and leaves me to interpret them.
Read more >
XMLHttpRequest module not defined/found - Stack Overflow
XMLHttpRequest is a built-in object in web browsers. It is not distributed with Node. The http module is the built-in tool for making...
Read more >
superagent - UNPKG
13, <p>SuperAgent is light-weight progressive ajax API crafted for flexibility, readability, and a low learning curve after being frustrated with many of ...
Read more >
node_modulesold/superagent/docs - GitLab
SuperAgent is light-weight progressive ajax API crafted for flexibility, ... DELETE can be also called as .del() for compatibility with old IE where...
Read more >
module-ajax-hermes - npm Package Health Analysis - Snyk
Hermes is a lightweight JavaScript library built on XMLHttpRequest to make AJAX calls. For more information about how to use this package see ......
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