useCollectionsDetails

πŸ›’ Use this hook to get all marketplace collections information (not include any item details except id and slug).

The useCollectionsDetails hook will call and return a response from the MarketplaceCollection API.

Hooks Sample Code

...
import useCollectionsDetails from "mojito-hooks/useCollectionsDetails";

function App {
    const { collections, isLoading } = useCollectionsDetails();

    if(isLoading) return <Loader />;


    if(collections) return collections.map((collection) => (
        <div>
            <h1>{collection.name}</h1>
            <div>
                {collection.items.map((item) => <DrawCollectionItem item={item} />)}
            </div>
        </div>
    ));

    return <div>No collections available</div>
}

Parameters

πŸ“˜

This hook doesn't accept any parameters.

Result

PropertyDescriptionType
collectionsMarketplace collections list.MojitoCollection
isLoadingDisplay request loading status, provided for convenience.Boolean
errorThe error object for the query, if an error was thrown.Error
refetchA function to manually refetch the query.(options: T) => Promise<U>
queryResultOriginal React-Query query result.QueryResult<T>