Skip to content

Why is there not something like promise.all ? #2124

Answered by n7ck
n7ck asked this question in Ideas
Discussion options

You must be logged in to vote

I realize that useSWR ( useSWRImmutable ) is not capable of doing what I want, which is if I make a call and pass it an array of fetch requests (an array because I don't know how many I will need ahead of time)

  1. [ /product/3, /product/4, /product/5 ] then
  2. [ /product/3, /product/5 ] then
  3. /product/3
  • then that is going to end up being 6 calls total because the array is considered the key, not each array item.

There is this though, in the works(?) that sounds promising ( useSWRList ) #1988

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@n7ck
Comment options

@lfjsa
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by n7ck
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants