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
WIP: feat: add schematics for @ngxs/store #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing! The only thing that needs to be tweaked is that the StateModel definitions should be interfaces and not classes. Strictly you should only store plain old javascript objects in your store, not any objects with prototypes or classes
WIP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Almost there.
Just a few variable name updates and an old library name left around.
Also we could potentially improve the auth module in the starter kit, but it depends on how far you want to go here. I think we could tweak the auth template later though after merging.
PS Just push a new commit into your branch with the fixes as opposed to squashing or rebasing so that it makes it easier to see the changes after this review. Thanks!
src/templates/starter-kit/store/dashboard/states/user/user.state.spec.ts
Outdated
Show resolved
Hide resolved
src/templates/starter-kit/store/dashboard/states/user/user.state.spec.ts
Outdated
Show resolved
Hide resolved
src/templates/starter-kit/store/dashboard/states/dictionary/dictionary.state.spec.ts
Outdated
Show resolved
Hide resolved
src/templates/starter-kit/store/dashboard/states/dictionary/dictionary.state.spec.ts
Outdated
Show resolved
Hide resolved
src/templates/starter-kit/store/dashboard/states/dictionary/dictionary.state.spec.ts
Outdated
Show resolved
Hide resolved
src/templates/starter-kit/store/dashboard/states/user/user.state.spec.ts
Outdated
Show resolved
Hide resolved
src/templates/starter-kit/store/dashboard/states/user/user.state.spec.ts
Outdated
Show resolved
Hide resolved
src/templates/starter-kit/store/dashboard/states/user/user.state.spec.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few more small tweaks
src/templates/starter-kit/store/dashboard/states/user/user.state.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Nicely done!
feat: add schematics for @ngxs/store (#3)
Hi, I have a question regarding to this feature. Would it be possible to have a sorter command line ? Something like |
Create issue please |
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?
ngxs/store#35
What is the new behavior?
Installation
Install Angular CLI
You should be using
@angular/cli@6.1.0
or newer.Install NGXS Schematics
Usage
Creating a new project
To generate new Angular project with NGXS Store, you can use
ng new
with@ngxs/schematics
specified as the schematics collection.Create a NGXS Store
To generate store with
@ngxs/schematics
:Result:
Or with spec:
Result:
Create a NGXS State
To generate state with
@ngxs/schematics
:Result:
Or with spec:
Result:
Create a NGXS Actions
To generate state with
@ngxs/schematics
:Result:
NGXS Starter Kit
Usage
To generate store with
@ngxs/schematics:starter-kit
:Result:
Does this PR introduce a breaking change?