Skip to content

Juicy is a simple Inversion of Control Library for javascript. Available for both browsers and commonJS module specifications like nodeJS

Notifications You must be signed in to change notification settings

shashwatsai/Juicy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Juicy

Juicy is a simple Inversion of Control Library for javascript. Available for both browsers and commonJS module specifications like nodeJS

Prerequisites | Using in Browsers

install browserify, you can install locally as well, but you will have to change the package.json

npm install -g browserify

npm run build-dist

Getting Started

Using Juicy in Browser

    var juicy = Juicy.getJuicy({debug:false});

    var userModel = function(name, position, confidence){
        this.name = name;
        this.position = position;
        this.confidence = confidence;
    }



    juicy.configureSingleton('userModel', userModel);

    var  q = {
        userModel: undefined
    }


    juicy.configureBean('q',q);
    juicy.attachBean('userModel','q','userModel');
    console.log(juicy.getObject('q').userModel);
            

And in NodeJS

    var juicyImpl = require('./src');

    var Juicy = juicyImpl.getJuicy({debug:false});
    
    class userModel{
        constructor(name, position, confidence){
            this.name = name;
            this.position = position;
            this.confidence = confidence;
        }
    }

    Juicy.configureSingleton('userModel', userModel);
    
    class q{
        constructor(){
            this.userModel = undefined;
        }
    }

    Juicy.configureClass('q',q);
    Juicy.attachBean('userModel','q','userModel');

    console.log(Juicy.getObject('q').userModel);

Authors

License

This project is licensed under the ISC

Acknowledgments

About

Juicy is a simple Inversion of Control Library for javascript. Available for both browsers and commonJS module specifications like nodeJS

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published