Giter VIP home page Giter VIP logo

ngrx-utils's Introduction

Build Status GitHub version npm version

Ngrx utils

A library containing tagging decorators for @ngrx to help implementing the Nrwl conventions for @ngrx/effects.

Getting started

Just install the package from npm.

npm i --save-dev @zalari/ngrx-utils

Runtime evaluation

This package includes tagging decorators and classes for runtime evaluation.

Usage example:

// command types as string based enums
export enum ExampleCommandTypes {
    Foo = '[Example] Foo'
}

// commands
export class FooCommand implements CommandAction {
    readonly type = ExampleCommandTypes.Foo;
}

Tagging decorators for Actions

The effects are distinguished into two groups, Deciders and Transformers.

Action Deciders

CLI tool

Additionally a command line tool is included to generate activity diagrams in the PlantUML file format from given effect files.

Run

The cli tool can be run using ngrx-utils.

If this somehow won't work, you can use node_modules/.bin/ngrx-utils on Linux or Mac, or node_modules/.bin/ngrx-utils.cmd on Windows.

Options

The options can be shown by running ngrx-utils --help:

    -V, --version                      output the version number
    -c, --config <path>                path to tsconfig.json
    -s, --source <path>                path to ngrx effects source file
    -d, --diagram <activity|sequence>  the diagram type to use (default: activity)
    -h, --help                         output usage information

Example using the test data

  • A simple test case is: ngrx-utils --config test/test.tsconfig.json --source test/test.effects.ts.
  • Globbing source files: ngrx-utils --config test/test.tsconfig.json --source **/*.effects.ts.
  • Extended tsconfig.json: ngrx-utils --config test/test-extending.tsconfig.json --source **/*.effects.ts.

By default the Angular CLI creates a base tsconfig.json in the root directory which is extended by specific config files in the src folder (e.g. tsconfig.app.json) by using the extends property. The CLI tool recognizes this property and loads all extended configs recursively and merges the compilerOptions.

Run tests

The tests are based on Mocha and Chai.

npm run test

ngrx-utils's People

Contributors

christianulbrich avatar davidenke avatar dependabot[bot] avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

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.