All Questions
506 questions
0
votes
0
answers
63
views
How to control the order of promise's callback [duplicate]
I have promises like this,
var results_arr = [];
var promises = [];
for (var i = 0 ; i < items.length;i++){
var url = `/api/stat/${items[i].id}`;
promises.push(
...
0
votes
1
answer
38
views
How to pass variables other than the Promises between multiple .then() chains?
After looking up answers about how to download files with Axios in React I implemented the following code:
const [fileName, setFileName] = useState("")
const [extension, setExtension] = ...
1
vote
1
answer
30
views
axios interceptor rejected promise doesn't trigger useMutation() isError parameter to turn to true
I am trying to use an axios interceptor return response.data or a rejected promise on error on every call to api.
I have confirmed the backend recieves the data and I can create a new user if all the ...
-1
votes
1
answer
43
views
How to migrate code with axios and promises to TypeScript?
I have a project written in Vue 2 (Options API)/JavaScript. The goal is to migrate to Vue 3 (Composition API)/TypeScript.
There is a code that works with API and I don't understand some TypeScript ...
0
votes
2
answers
59
views
Using promise.all with .then
I want to use await Promise.all with axios so that the requests can be sent concurrently. I have a map with the key as an id, and the value as an url. I want to retain the output also in a similar map,...
-3
votes
1
answer
63
views
Axios becomes a promise
The console.log outputs of the api and axios variables in the following code are different, even though I didn't change anything. api is the normal axios but the state axios becomes a Promise.
import {...
1
vote
1
answer
48
views
Initializing a list within ngOnInit using axios
I have a component in which I'd like to load objects received from the backend.
ngOnInit() {
this.source.load(this.myService.findAll());
}
in myService, I use Axios to fetch the data from ...
0
votes
0
answers
98
views
Uncaught in Promise handlerror (Axios Error) in ReactJS
So I am making a blog application.
I have used an axios inceptors concept name is api.js -
import axios from 'axios';
import { API_NOTIFICATION_MESSAGES, SERVICE_URLS } from '../constants/config';
...
0
votes
3
answers
133
views
Cannot make React axios work when doing two GETs in a row [duplicate]
I am working with OpenWeatherMap in order to grab the current weather of, say, Helsinki.
My latest MNWE (N as non) is:
import axios from 'axios'
const apiKey = import.meta.env.VITE_OWM_API_KEY
const ...
0
votes
1
answer
75
views
How to define the correct type for the Promise.all response iterable?
As we know that the Promise.all will return settled promise in the same order of the requested iterable.
I am trying to understand how to put correct type for individual settled resolve.
I am using ...
1
vote
0
answers
241
views
How to pause promise chain to wait for a button click?
I'm trying to chain some backend calls to process a file, but the entire workflow needs some input from the user midway. I'm not sure how to pause the execution until the user clicks a button to "...
0
votes
1
answer
182
views
Can I return a single error with Promise.allSettled() on a multiple axios post?
I am sending objects with more than one value in the list to a single api, and I have done this in successive objects as follows.
Redux action:
import { axios } from "@lib/axios";
export ...
0
votes
2
answers
49
views
node axios call does not await promise
When I make network call via axios, the consuming service does not await it
Executing function:
accountResolved: (atNumber, bkCode) => {
return new Promise((resolve, reject) => {
axios....
-1
votes
1
answer
455
views
Axios catch crashes code, marked "UnhandledPromiseRejection"
I am trying to handle an axios call failure.
I wrote the function and the code:
async function createFunction (url, APIKEY, vendorType) {
return new Promise((resolve, reject) => {
const ...
-1
votes
1
answer
53
views
axios aync wait is not waiting for response
I am doing a axios.post and trying to update store with the result. To test await functionality, I am doing debug in server side and holding the flow by putting a break point. But in react side, it is ...