src/app/product/actions/product-actions.ts
getAllProducts |
getAllProducts()
|
Returns:
Action
|
getProductDetail |
getProductDetail(id: string)
|
Returns:
Action
|
getAllProductsSuccess |
getAllProductsSuccess(products: any)
|
Returns:
Action
|
getProductDetailSuccess |
getProductDetailSuccess(product: Product)
|
Returns:
Action
|
clearSelectedProduct |
clearSelectedProduct()
|
Returns:
Action
|
getAllTaxonomies |
getAllTaxonomies()
|
Returns:
Action
|
getAllTaxonomiesSuccess |
getAllTaxonomiesSuccess(taxonomies: any)
|
Returns:
Action
|
Static CLEAR_SELECTED_PRODUCT |
CLEAR_SELECTED_PRODUCT: |
Default value: CLEAR_SELECTED_PRODUCT
|
Static GET_ALL_PRODUCTS |
GET_ALL_PRODUCTS: |
Default value: GET_ALL_PRODUCTS
|
Defined in src/app/product/actions/product-actions.ts:6
|
Static GET_ALL_PRODUCTS_SUCCESS |
GET_ALL_PRODUCTS_SUCCESS: |
Default value: GET_ALL_PRODUCTS_SUCCESS
|
Defined in src/app/product/actions/product-actions.ts:7
|
Static GET_ALL_TAXONOMIES |
GET_ALL_TAXONOMIES: |
Default value: GET_ALL_TAXONOMIES
|
Static GET_ALL_TAXONOMIES_SUCCESS |
GET_ALL_TAXONOMIES_SUCCESS: |
Default value: GET_ALL_TAXONOMIES_SUCCESS
|
Static GET_PRODUCT_DETAIL |
GET_PRODUCT_DETAIL: |
Default value: GET_PRODUCT_DETAIL
|
Defined in src/app/product/actions/product-actions.ts:8
|
Static GET_PRODUCT_DETAIL_SUCCESS |
GET_PRODUCT_DETAIL_SUCCESS: |
Default value: GET_PRODUCT_DETAIL_SUCCESS
|
Defined in src/app/product/actions/product-actions.ts:9
|
import { Taxonomy } from './../../core/models/taxonomy';
import { Product } from './../../core/models/product';
import { Action } from '@ngrx/store';
export class ProductActions {
static GET_ALL_PRODUCTS = 'GET_ALL_PRODUCTS';
static GET_ALL_PRODUCTS_SUCCESS = 'GET_ALL_PRODUCTS_SUCCESS';
static GET_PRODUCT_DETAIL = 'GET_PRODUCT_DETAIL';
static GET_PRODUCT_DETAIL_SUCCESS = 'GET_PRODUCT_DETAIL_SUCCESS';
static CLEAR_SELECTED_PRODUCT = 'CLEAR_SELECTED_PRODUCT';
static GET_ALL_TAXONOMIES = 'GET_ALL_TAXONOMIES';
static GET_ALL_TAXONOMIES_SUCCESS = 'GET_ALL_TAXONOMIES_SUCCESS';
getAllProducts(): Action {
return { type: ProductActions.GET_ALL_PRODUCTS };
}
getProductDetail(id: string): Action {
return {
type: ProductActions.GET_PRODUCT_DETAIL,
payload: id
};
}
// change products type to Product[]
getAllProductsSuccess(products: any): Action {
return {
type: ProductActions.GET_ALL_PRODUCTS_SUCCESS,
payload: products
};
}
getProductDetailSuccess(product: Product): Action {
return {
type: ProductActions.GET_PRODUCT_DETAIL_SUCCESS,
payload: product
};
}
clearSelectedProduct(): Action {
return { type: ProductActions.CLEAR_SELECTED_PRODUCT };
}
getAllTaxonomies(): Action {
return { type: ProductActions.GET_ALL_TAXONOMIES };
}
getAllTaxonomiesSuccess(taxonomies: any): Action {
return {
type: ProductActions.GET_ALL_TAXONOMIES_SUCCESS,
payload: taxonomies
};
}
}