Skip to content

constructor only dependency injection for JavaScript Typescript + Intellisense

Notifications You must be signed in to change notification settings

webbersmak/emplore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 

Repository files navigation

emplore js

Usage:

class item1 {
    public name = "a white staff";
}

class item2 {
    public name = "a fire spell";
}

class mage {
    constructor(first: item1, second: item2) {
        alert("a wild mage appears with " + first.name + " and " + second.name);
    }
}

register("item1", [], item1);
register("item2", [], item2);
register("mage", ["item1", "item2"], mage);

The main module does not need to return anything. The "window.onload" event starts the modules. All modules are registered as singletons. Create a factory module if you need multiple instances of a class.

license: MIT License, Copyright (c) 2017 webbersmak

About

constructor only dependency injection for JavaScript Typescript + Intellisense

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published