-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
feat(schematics): add the ability to create actions with the prefix #3025
feat(schematics): add the ability to create actions with the prefix #3025
Conversation
Preview docs changes for ef7553c at https://previews.ngrx.io/pr3025-ef7553cc/ |
733e2cb
to
3b565b4
Compare
@timdeschryver I came up with the idea to generate actions with many prefixes by using one command. For example - for the action schematics we can pass an array with prefixes ([load, create, update, delete]) and then generate actions with all prefixes from the array. What do you think about this idea? |
@mateuszbasinski I think that's a good idea. The only downside is that this leads to command-driven actions, while we encourage event-driven actions. |
@timdeschryver I tried to deal with this using split. The output of splitted array looks good. |
Then I think we can extend the schematic to create multiple defaults, as long as the default remains "load". |
I think this PR is good, but I don't think we should add comma-separated prefixes. As Tim mentioned, we're already violating event-driven actions, so I want to change those to be more correct, such as:
I also think the goal of the schematics is to generate the minimum of what you need, and not try to auto-generate everything. |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
The actions are created only with the prefix Load.
Closes #3012
What is the new behavior?
The actions are created with a specified prefix.
Does this PR introduce a breaking change?
Other information