Home > @shopware-pwa/composables > createListingComposable
# createListingComposable() function
Factory to create your own listing. By default you can use useListing composable, which provides you predefined listings for category(cms) listing and product search listing. Using factory you can provide our own compatible search method and use it for example for creating listing of orders in my account.
Signature:
export declare function createListingComposable<ELEMENTS_TYPE>({ searchMethod, searchDefaults, listingKey, }: {
searchMethod: (searchParams: Partial<ShopwareSearchParams>) => Promise<ListingResult<ELEMENTS_TYPE>>;
searchDefaults: ShopwareSearchParams;
listingKey: string;
}): IUseListing<ELEMENTS_TYPE>;
# Parameters
Parameter | Type | Description |
---|---|---|
{ searchMethod, searchDefaults, listingKey, } | { searchMethod: (searchParams: Partial<ShopwareSearchParams>) => Promise<ListingResult<ELEMENTS_TYPE>>; searchDefaults: ShopwareSearchParams; listingKey: string; } |
Returns:
IUseListing<ELEMENTS_TYPE>