Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schematics:feature generates incorrect code for Effects #1356

Closed
krzysztof-grzybek opened this issue Oct 9, 2018 · 5 comments
Closed

Schematics:feature generates incorrect code for Effects #1356

krzysztof-grzybek opened this issue Oct 9, 2018 · 5 comments
Labels
community watch Someone from the community is working this issue/PR Project: Effects

Comments

@krzysztof-grzybek
Copy link
Contributor

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

@timdeschryver
Copy link
Member

timdeschryver commented Oct 9, 2018

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

@krzysztof-grzybek
Copy link
Contributor Author

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

@timdeschryver timdeschryver added the community watch Someone from the community is working this issue/PR label Oct 9, 2018
@timdeschryver
Copy link
Member

Thanks @krzysztof-grzybek!

@dummdidumm
Copy link
Contributor

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

@brandonroberts
Copy link
Member

Fixed via #1357

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community watch Someone from the community is working this issue/PR Project: Effects
Projects
None yet
Development

No branches or pull requests

4 participants