Installing and setting it up 

Installing it is as easy as performing the following command in your terminal:

npm install @ngrx/effects --save

The next step is to set it up. The setup can be seen as consisting of two steps:

  • Create our effect
  • Register the effect with the EffectsModule

An effect is just an injectable service that listens for a specific action. Once the effect is in focus, it can carry out a number of operations and transformations before leaving over control. It leaves over control by dispatching an action. 

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.