Platform: Schematics:feature generates incorrect code for Effects

Created on 9 Oct 2018  路  5Comments  路  Source: ngrx/platform

Minimal reproduction of the bug/regression with instructions:

The following command:
ng generate @ngrx/schematics:feature customName
generates effects file:

import { Injectable } from '@angular/core';
import { Actions, Effect, ofType } from '@ngrx/effects';
import { CustomNameActionTypes } from './custom-name.actions';

@Injectable()
export class CustomNameEffects {

  @Effect()
  loadFoos$ = this.actions$.pipe(ofType(CustomNameActionTypes.LoadCustomNames));

  constructor(private actions$: Actions) {}
}

Expected behavior:

I think that instead of loadFoos$ it should be loadCustomNames$:

import { Injectable } from '@angular/core';
import { Actions, Effect, ofType } from '@ngrx/effects';
import { CustomNameActionTypes } from './custom-name.actions';

@Injectable()
export class CustomNameEffects {

  @Effect()
  loadCustomNames$ = this.actions$.pipe(ofType(CustomNameActionTypes.LoadCustomNames));

  constructor(private actions$: Actions) {}
}


Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):

"@ngrx/schematics": "^6.1.0",
"@angular/core": "^6.1.0",
node: 10.9.0

Other information:

I would be willing to submit a PR to fix this issue

[x] Yes (Assistance is provided if you need help submitting a pull request)
[ ] No

Effects community watch

All 5 comments

馃憤, do you mind sending a Pull Request to get this solved?

Sure! I'll do it today or tomorrow at the latest.

Thanks @krzysztof-grzybek!

Since the PR was merged, this can be closed, right?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brandonroberts picture brandonroberts  路  3Comments

smorandi picture smorandi  路  3Comments

ghost picture ghost  路  3Comments

sandangel picture sandangel  路  3Comments

NathanWalker picture NathanWalker  路  3Comments