Generating an effect

You generate an effect by typing the following:

ng generate effect jedis

This will produce the files:

  • jedis.effect.ts
  • jedis.effect.spec.ts

The effects file looks like this:

import { Injectable } from '@angular/core';import { Actions, Effect } from '@ngrx/effects';@Injectable()export class JedisEffects {  constructor(private actions$: Actions) {}}

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.