Giter Site home page Giter Site logo

ngrx-generator's Introduction

ngrx-generator

Save yourself the headache of Redux boilerplate Awesome

Demo

Getting Started

Install it via npm:

npm install ngrx-generator -g
ngrx-gen

By default, it will create the templates in the current directory. If you prefer the ngrx/example style -

- reducers
- services
- actions
- effects
- services

you can add the following line to your package.json

{
 "ngrxGen": {
   "basePath": "./src/app", // optional - this should be relative to your root package.json file
   "seperateDirectory": "true"
 }
}

Demo

License

MIT

ngrx-generator's People

Contributors

netanelbasal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ngrx-generator's Issues

Feature request: Configure paths for storing parts of ngrx when separateDirectory is true

It's a great generator. Saves me whole bunch of time of writing those manually, I even hooked up an npm command in order not to install it globally. I have one feature request though. Would it be possible to configure paths via package.json where the files should be added. For example my structure requires to put actions, effects in ./app/shared/effects, ./app/shared/actions etc.

Regards

Http -> HttpClient

I believe HttpClient is what we should use under Angular 4.3

Bad thing is that it affects effects, service & service.spec templates.

Also option for configurable template base path would be awesome.

how to generate folders in a specific path

I'm having multiple modules in my app, and I would like to generate folders in specific folders. Specifying the baseDir in package.json doesn't help as it would change based on which module I'd like to use. Any suggestions?

ngrx/entity Feature Request

I think it will be more useful if you will be having a boilerplate for ngrx/entity. Let me know your thoughts. Thanks! :)

ngrx-gen doesn't generate folders even with package.json settings

I added below script to my package.json

"ngrxGen": {
   "basePath": "./src/app", // optional - this should be relative to your root package.json file
   "seperateDirectory": "true"
 }

But, ngrx-gen still generates default files in the root. It doesn't create the folder structure.

Add namespaces to actions and reducer

Cool library!
Did you consider adding a namespace for the *.actions.ts and *.reducer.ts generated files.
e.g.,

teams.actions.ts file will have:

import { Action } from '@ngrx/store';

export namespace TeamUsersActions{
  export const LOAD =                 '[Team Users] Load';
  export const LOAD_SUCCESS =         '[Team Users] Load Success';
  export const LOAD_FAIL =            '[Team Users] Load Fail';
  /**
   * Load Team Users Actions
   */
  export class LoadAction implements Action {
    readonly type = LOAD;
  }

  export class LoadSuccessAction implements Action {
    readonly type = LOAD_SUCCESS;

    constructor(public payload: any) { }
  }

  export class LoadFailAction implements Action {
    readonly type = LOAD_FAIL;

    constructor(public payload: any) { }
  }

  export type Actions =
    | LoadAction
    | LoadSuccessAction
    | LoadFailAction;
}

Then you can use it as:

import {TeamUsersActions} from "./team-users.actions";
TeamUsersActions.LoadAction() and TeamUsersActions.Actions etc.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.