-
-
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
Entity schematics should update the state with a plural instead of a singular #1412
Comments
I think this would indeed be better. |
@jdjuan I agree with this fix. |
Hey! Sorry for the late reply! Sure, I'd love to! ⭐️ I'd appreciate it! @brandonroberts @timdeschryver |
Awesome! The schematics module is located at The next piece of code is where we modify the existing reducers and state with So in short, you'll have to take a look at the More specific: const stateInterfaceInsert = addReducerToStateInterface(
source,
reducersPath,
options
);
const reducerMapInsert = addReducerToActionReducerMap(
source,
reducersPath,
options
); NOTE: Feel free to reach out when you want to verify something! |
Having Consider using @ngrx/Entity:
|
@timdeschryver thanks for the heads-up! This certainly clarifies how to start! 👏👏👏
|
That is a valid option. In the past, I created extra tests inside In these tests, we set up a virtual directory and verify that files are created and/or the content in these files (to run the tests you can use |
@peterbsmith2 you make valid points, but when would one use Also database wise, the convention is also to pluralize the table names. |
Circling back on this @jdjuan. If you're still interested in making this change, what do you need to move forward? |
@brandonroberts @timdeschryver I'm truly sorry I didn't finish this 😢 |
@jdjuan no problem. Sorry we didn't get back to you sooner. |
@brandonroberts let me take care of this, also can i merge #1564 |
@santoshyadav198613 Sure! But keep them as separate PRs. |
Hi @brandonroberts , To achieve this we have to use plural function the changes are required at schematics-core/utility/ngrx-utils line no 93. We are using regex as of now, for plural got 2 options
I tried with both and it works fine. |
Minimal reproduction of the bug/regression with instructions:
Check this repository for the generated files. But here is the interesting part:
Expected behavior:
According to the documentaiton here, it seems like entities should be defined as plural in the state:
Versions of NgRx, Angular, Node, affected browser(s) and operating system(s):
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
The text was updated successfully, but these errors were encountered: