'How to use the .multi() method?

I finished the substrate kitty tutorial (backend and frontend). Now I would like to build a simple frontend for the RMRK pallet. Now I stuck on the .multi(...) method. Where can I find a documentation about this .multi-method?

      unsub = await api.query.rmrkCore.collections.multi(collectionIds, collections => {
          const collectionsMap = collections.map(collection => parseCollection(collection.unwrap()));
          setCollections(collectionsMap);
      });

The collection.unwrap() returns an error because it is [null,null]

--> However, with the following code I get a nice map<id,collections>

const entries = await api.query.rmrkCore.collections.entries();
const ids = entries.map(entry => entry[0]);
setCollectionIds(ids);

My goal is to parse the collections and store them (setCollections(collectionsMap))

I am grateful about any help :)



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source