Can someone explain me how to use useSerialRequest #181
Replies: 5 comments 9 replies
-
Yes, the requestX function is means that the function returns a the |
Beta Was this translation helpful? Give feedback.
-
@starfallproduction According to your situation, you can use const handleCertainEvent = async () => {
const promises = [request1(args).send()];
if (someCondition) {
promises.push(request2(args).send());
}
const [response1, response2] = await Promise.all(promises);
// ...
}
this solution need to create and maintain states related request. like In future, it can be considered to write a use hook about parallel, such as |
Beta Was this translation helpful? Give feedback.
-
But still, I am still confused about useSerialRequest. |
Beta Was this translation helpful? Give feedback.
-
Alright thank you very much for helping me. |
Beta Was this translation helpful? Give feedback.
-
@starfallproduction I'm doing an survey about "Why using alova". Could you please tell me why replace |
Beta Was this translation helpful? Give feedback.
-
Hi, I have some question.
I just don't get how to use useSerialRequest.
I already looked on the documentation, but seem the documentation is lacking in explanation.
I don't get how to create serialHandlers.
In the documentation, to create serialHandler you need to pass a lambda function that return request(args).
First, what is request(args)?
The documentation doesn't show the function of request is pointed to.
The documentation only show request1, request2, request3.
What type is request? Is it requestMethodInstance? can someone give me clearance how can I create serialRequest Hander.
Beta Was this translation helpful? Give feedback.
All reactions