March 2018
Intermediate to advanced
364 pages
8h 21m
English
The next order of business is to update our products.actions.ts file with the new methods that we need to support the preceding code:
// products.actions.tsimport { FETCHING_PRODUCTS_SUCCESSFULLY, FETCHING_PRODUCTS_ERROR, FETCHING_PRODUCTS, ADD_PRODUCT, ADD_PRODUCT_SUCCESSFULLY, ADD_PRODUCT_ERROR} from "./product.constants";export const fetchProductsSuccessfully = (products) => ({ type: FETCHING_PRODUCTS_SUCCESSFULLY, payload: products});export const fetchError = (error) => ({ type: FETCHING_PRODUCTS_ERROR, payload: error });export const fetchProductsLoading = () => ({ type: FETCHING_PRODUCTS });export const fetchProducts = () => ({ type: FETCHING_PRODUCTS });export const addProductSuccessfully (product) => ({ type: ...
Read now
Unlock full access