Creating our constants

Let's start with our constants file. What we need are constants that will support us firing away an AJAX request. We also need a constant for when we get our data back successfully, but we also need to cater to any error that might occur. This means we need the following three constants:

// product/product.constants.tsexport const FETCHING_PRODUCTS = "FETCHING_PRODUCTS";export const FETCHING_PRODUCTS_SUCCESSFULLY = "FETCHING_PRODUCTS_SUCCESSFULLY";export const FETCHING_PRODUCTS_ERROR = "FETCHING_PRODUCTS_ERROR";

Get Architecting Angular Applications with Redux, RxJS, and NgRx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.