1.1.12 • Published 9 years ago

toybricks v1.1.12

Weekly downloads
78
License
-
Repository
-
Last release
9 years ago

#Toybricks

The javascript annotation and DI(dependency injectioin) framework

##Dependency indection Toybricks provided some annotations itself,among them,the annotation "extention" to help your system flexable like a Russian nesting dolls. Here is a real case:

module.exports = {
    deleteItem:function*(_itemObj){
        yield dao.del(_itemObj);
        delExt(rtn);
        return {suc:true};
    }
}
/**
 * Dao annotation
 */
'@dao';
var dao = function(){
    throw new Error('No one implement me?oh my God....');
}

/**
 * Extention for delete an object
 */
'@extention';
var delExt = function(_itemObj){}

The extention point was described in toybricks.json file:

{
    "extentions": [
        {
            "name": "delAfter",
            "path": "./lib/biz:delExt",
            "desc": "The extention after delete item object."
        }
    ]
}

In another module,you can extend it(toybricks.json file) like this:

{
    "junctions": [
        {
            "from": "./my/ext:afterDel",
            "to": "cloudIDE:delAfter"
        }
    ]
}
1.1.12

9 years ago

1.1.11

9 years ago

1.1.10

9 years ago

1.1.9

9 years ago

1.1.8

9 years ago

1.1.7

9 years ago

1.1.6

9 years ago

1.1.4

9 years ago

1.1.3

9 years ago

1.1.2

9 years ago

1.1.1

9 years ago

1.1.0

9 years ago

1.0.9

9 years ago

1.0.7

9 years ago

1.0.4

9 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago