Replies: 1 comment
-
should be something like: for (const obj of bulkUsers) {
try {
await createOneUser(obj).unwrap()
} catch (err) {
break;
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an array of items that I want to insert into the database one after another, something like this:
so basically, there would be a for..of loop iterating over this array and inserting them one after the another.
I want to break out of the loop once an error happens, so for instance the error occurred after the 8th item:
So I want to stop the execution at this phase, how to implement this using redux toolkit queries:
my code looks like this:
I know that this looks different from how we usually do the stuff using
useEffect
, but that's just a drafted plan to implement this. and I have no idea how to do this.How to implement a similar logic in the redux toolkit query?
Beta Was this translation helpful? Give feedback.
All reactions