@ngrx/schematics: actions generated with plural
Currently, generating actions with the schematics results in a file containing an initial action that follows the structure <prefix><actionName>s.
In a more pratical example, this is probably to result in things like loadBooks. However, this makes an assumption that states are always created with singular names and that the action refers to something that will be containing multiple items.
However, if we look at the NGRX walkthrough, we'll see that the books example was created with all files already pluralized (e.g books.actions.ts)
But if this was generated with the schematics, the file output would be as following:
import { createAction, props } from '@ngrx/store';
export const loadBookss = createAction(
'[Books] Load Bookss'
);
Notice the double "s" there. To avoid this, the file would have to be named book.actions.ts (singular), which seems a bit off when we're dealing with "collections".
The double "s" seems like a quick fix, but it a bit inconvenient and it populates to a couple more files, specially if you are creating an entire feature ng g f.
Also, another problem is that it's not rare to see state management for a single thing, like User. We could very well have a User state with a loadUser action, but the schematics would create a loadUsers action within an user.actions.ts file.
My suggestion here would be to remove this "s" suffix entirely and leave the plural according to the file name, but I recognize this is not a straight forward decision, which is why I opened an issue before a PR.
Thanks for raising this issue @guilhermetod , could you please share the schematic commands that you've used.