this is a silly question but what's the best way t...
# javascript
m
this is a silly question but what's the best way to render a list of images from storage? im not sure how to map over the list and convert each img in to a blob
Copy code
js
    async function getPath() {
      try {
        setLoading(true)
        
        let { data, error, status } = await supabase.storage
        .from("user-library")
        .list("", {
          limit: 100,
        })
        if(error) {
          throw error
        }
        const imageURL = data.map(item => URL.createObjectURL(item)) /* THIS LINE */
        console.log(imageURL)

      } catch (error) {
        console.log("error", error);
      }
    }
g
There is no array download from storage, so each file has to be pulled down one at a time.
m
interesting, ok so the way i did it is right? > am i supposed to list and then run another function to download from that list based on name of each image?
g
Yeah, it is one extra request to get the list.
m
ok perfect thank u!!