radis
    TypeScript icon, indicating that this package has built-in type declarations

    2.0.0 • Public • Published

    Radis logo

    Travis Coverage Status Greenkeeper badge

    NPM

    Quickstart

     
    const { radis } = require('radis');
     
     
    class Unicorn {
      constructor(name) {
          this.name = name;
      }
      
      poop() {
        console.log(`${this.name} poop rainbow`);
      }
    }
     
    class UnicornProvider {
        constructor($injector, name) {
            this.name = name;
        }
        setName(name) {
            this.name = name;
        }
        $get() {
            return new Unicorn(this.name);
        }
    }
     
    radis
        .module('app', [])
        .provider('alice', UnicornProvider)
        .provider('anonymousUnicorn', UnicornProvider)
        .config((anonymousUnicornProvider) => anonymousUnicornProvider.setName("paul"))
        .run((alice, anonymousUnicorn) => {
            alice.poop(); // alice poop rainbow
            anonymousUnicorn.poop(); // paul poop rainbow
        })
        .bootstrap()
    ;

    Requirement

    Radis use ES6 syntax internally so it require node >= 6.

    Documentation

    Go to documentation

    Keywords

    none

    Install

    npm i radis

    DownloadsWeekly Downloads

    44

    Version

    2.0.0

    License

    MIT

    Unpacked Size

    202 kB

    Total Files

    32

    Last publish

    Collaborators

    • avatar