ngxs-state-generate
v0.1.3
Published
Schematics for generating NGXS states
Maintainers
Readme
NGXS State Generator
A schematic for generating NGXS state files (actions, selectors, and states) in Angular projects.
Installation
Install the package as a development dependency:
npm install --save-dev ngxs-state-generateOr with Yarn:
yarn add --dev ngxs-state-generateUsage
Use the Angular CLI to run the schematic and generate NGXS state files:
ng generate ngxs-state-generate:state <state-name> [options]Options
--save(boolean): Persist state between application restarts (default:false).--no-import(boolean): Skip adding the state to imports or providers (default:false).--path(string): Specify the path to create the state files (defaults to the current directory).
Example:
ng generate ngxs-state-generate:state my-state --save --noImport --path=src/app/statesThis generates NGXS state-related files (e.g., my-state.state.ts) in the specified path.
Prerequisites
- Angular CLI (
@angular/cli) version compatible with@angular-devkit/schematics@^19.2.9. - NGXS (
@ngxs/store) installed in your project.
