GitHub

DaffProductServiceInterface

import { DaffProductServiceInterface } from '@daffodil/product/driver'

An interface for any Product service drivers.

interface DaffProductServiceInterface<T extends DaffProduct = DaffProduct> {
  getAll(): Observable<T[]>
  getBestSellers(): Observable<T[]>
  get(productId: T["id"]): Observable<DaffProductDriverResponse<T>>
  getByUrl(url: string): Observable<DaffProductDriverResponse<T>>
}

() Methods

getAll
Observable<T[]>

Get all products.

getBestSellers
Observable<T[]>

Get best selling products.

get
Observable<DaffProductDriverResponse<T>>

Get a product by Id.

Parameters
ParameterproductId: T["id"]
Description

A string of the product ID.

getByUrl
Observable<DaffProductDriverResponse<T>>

Get a product by URL.

Parameters
Parameterurl: string
Description

A string of the product URL.

See DaffLocatable for more information on the requirements for the url argument of DaffProduct.