File

projects/core/src/product/connectors/product/product.adapter.ts

Index

Methods

Methods

Abstract load
load(productCode: string, scope?: string)

Abstract method used to load product's details data. Product's data can be loaded from alternative sources, as long as the structure converts to the Product.

Parameters :
Name Type Optional Description
productCode string No

The productCode for given product

scope string Yes

The product scope to load

Returns : Observable<Product>
Abstract Optional loadMany
loadMany(products: ScopedProductData[])

Abstract method used to load data for multiple product and scopes Adapter is able to optimize necessary backend calls and load products in the most efficient way possible.

Parameters :
Name Type Optional
products ScopedProductData[] No
import { Observable } from 'rxjs';
import { Product } from '../../../model/product.model';
import { ScopedProductData } from './scoped-product-data';

export abstract class ProductAdapter {
  /**
   * Abstract method used to load product's details data.
   * Product's data can be loaded from alternative sources, as long as the structure
   * converts to the `Product`.
   *
   * @param productCode The `productCode` for given product
   * @param scope The product scope to load
   */
  abstract load(productCode: string, scope?: string): Observable<Product>;

  /**
   * Abstract method used to load data for multiple product and scopes
   * Adapter is able to optimize necessary backend calls and load
   * products in the most efficient way possible.
   *
   * @param products
   */
  abstract loadMany?(products: ScopedProductData[]): ScopedProductData[];
}

result-matching ""

    No results matching ""