Extending our example with the create effect

So far, we have gone through the full flow of adding an effect, building a component, and improved the code with selectors. To make sure we really understand how to work with effects and how the application scales with it, let's add another effect, this time let's add an effect to support an HTTP POST call. What we want to happen from an application standpoint is that we add another product to the list. This should update the UI and show our added product. What happens data-wise is that our store should reflect that change and, as a side effect, a HTTP POST should be carried out. We need the following to accomplish this:

  • A reducer that supports adding a product to our products list
  • An effect that ...

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.