Angular NgRx Create Effect

    0

    0

    Jose Romero

    Angular TypeScript Recipes

    When the code executes, it creates an Effect object and initializes it with an empty observable. Then, it calls the ofType() method on the actions observable, telling it to grab input from the action observable. Lastly, it calls the operator()() method on the EMPTY observable, telling it to emit completion events.

    Library: angular

    Shortcut: angular.ngrx.effect.create

    effectName$ = createEffect(() => {
      return this.actions$.pipe(
          ofType(action),
          /** An EMPTY observable only emits completion. Replace with your own observable stream */
          operator(() => EMPTY));
    });
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    Legal
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.