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: Update default action/reducer/effect template to be less generic #1040

Closed
brandonroberts opened this issue May 9, 2018 · 2 comments

Comments

@brandonroberts
Copy link
Member

brandonroberts commented May 9, 2018

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[x] Feature request
[ ] Documentation issue or request

What is the current behavior?

Expected behavior:

Minimal reproduction of the problem with instructions:

Version of affected browser(s),operating system(s), npm, node and ngrx:

Other information:

Right now the templates for a generated action blueprint are very generic (e.g.) [User] Action. This should be updated to be less generic and more usable out of the box. We should extend this to the reducer and effects also when generating a feature.

export enum UserActionTypes {
  LoadUsers = '[User] Load Users'
}

export class LoadUsers implements Action {
  readonly type = UserActionTypes.LoadUsers;
}

export type UserActions = LoadUsers;
@brandonroberts
Copy link
Member Author

cc: @ThomasBurleson

brandonroberts added a commit that referenced this issue May 10, 2018
Closes #1040

BREAKING CHANGE:

The action blueprint has been updated to be less generic, with associated reducer and effects updated for the feature blueprint

BEFORE:

export enum UserActionTypes {
  UserAction = '[User] Action'
}

export class User implements Action {
  readonly type = UserActionTypes.UserAction;
}

export type UserActions = User;

AFTER:

export enum UserActionTypes {
  LoadUsers = '[User] Load Users'
}

export class LoadUsers implements Action {
  readonly type = UserActionTypes.LoadUsers;
}

export type UserActions = LoadUsers;
brandonroberts added a commit that referenced this issue May 10, 2018
)

Closes #1040

BREAKING CHANGE:

The action blueprint has been updated to be less generic, with associated reducer and effects updated for the feature blueprint

BEFORE:

export enum UserActionTypes {
  UserAction = '[User] Action'
}

export class User implements Action {
  readonly type = UserActionTypes.UserAction;
}

export type UserActions = User;

AFTER:

export enum UserActionTypes {
  LoadUsers = '[User] Load Users'
}

export class LoadUsers implements Action {
  readonly type = UserActionTypes.LoadUsers;
}

export type UserActions = LoadUsers;
@ThomasBurleson
Copy link
Contributor

@brandonroberts - darn. Now I have to check in the Nx Schematics if you have ALREADY done this work above. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants