Home > @shopware-pwa/composables > createListingComposable
# createListingComposable() function
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
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>({ rootContext, searchMethod, searchDefaults, listingKey, }: {
rootContext: ApplicationVueContext;
searchMethod: (searchParams: Partial<ShopwareSearchParams>) => Promise<ProductListingResult>;
searchDefaults: ShopwareSearchParams;
listingKey: string;
}): IUseListing<ELEMENTS_TYPE>;
# Parameters
Parameter | Type | Description |
---|---|---|
{ rootContext, searchMethod, searchDefaults, listingKey, } | { rootContext: ApplicationVueContext; searchMethod: (searchParams: Partial<ShopwareSearchParams>) => Promise<ProductListingResult>; searchDefaults: ShopwareSearchParams; listingKey: string; } |
Returns:
IUseListing<ELEMENTS_TYPE>