### File

`src/app/product/actions/product-actions.ts`

### Methods

getAllProducts
`getAllProducts()`
Defined in src/app/product/actions/product-actions.ts:14
Returns: `Action`

getProductDetail
`getProductDetail(id: string)`
Defined in src/app/product/actions/product-actions.ts:18
Returns: `Action`

getAllProductsSuccess
`getAllProductsSuccess(products: any)`
Defined in src/app/product/actions/product-actions.ts:26
Returns: `Action`

getProductDetailSuccess
`getProductDetailSuccess(product: Product)`
Defined in src/app/product/actions/product-actions.ts:33
Returns: `Action`

clearSelectedProduct
`clearSelectedProduct()`
Defined in src/app/product/actions/product-actions.ts:40
Returns: `Action`

getAllTaxonomies
`getAllTaxonomies()`
Defined in src/app/product/actions/product-actions.ts:44
Returns: `Action`

getAllTaxonomiesSuccess
`getAllTaxonomiesSuccess(taxonomies: any)`
Defined in src/app/product/actions/product-actions.ts:48
Returns: `Action`

### Properties

Static CLEAR_SELECTED_PRODUCT
`CLEAR_SELECTED_PRODUCT: `string``
Default value: `CLEAR_SELECTED_PRODUCT`
Defined in src/app/product/actions/product-actions.ts:10

Static GET_ALL_PRODUCTS
`GET_ALL_PRODUCTS: `string``
Default value: `GET_ALL_PRODUCTS`
Defined in src/app/product/actions/product-actions.ts:6

Static GET_ALL_PRODUCTS_SUCCESS
`GET_ALL_PRODUCTS_SUCCESS: `string``
Default value: `GET_ALL_PRODUCTS_SUCCESS`
Defined in src/app/product/actions/product-actions.ts:7

Static GET_ALL_TAXONOMIES
`GET_ALL_TAXONOMIES: `string``
Default value: `GET_ALL_TAXONOMIES`
Defined in src/app/product/actions/product-actions.ts:11

Static GET_ALL_TAXONOMIES_SUCCESS
`GET_ALL_TAXONOMIES_SUCCESS: `string``
Default value: `GET_ALL_TAXONOMIES_SUCCESS`
Defined in src/app/product/actions/product-actions.ts:12

Static GET_PRODUCT_DETAIL
`GET_PRODUCT_DETAIL: `string``
Default value: `GET_PRODUCT_DETAIL`
Defined in src/app/product/actions/product-actions.ts:8

Static GET_PRODUCT_DETAIL_SUCCESS
`GET_PRODUCT_DETAIL_SUCCESS: `string``
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
            };
        }
    }

# results matching ""

# No results matching ""