dotnode
Version:
.NET-like MVC framework for Node.js
44 lines (28 loc) • 833 B
JavaScript
var BindingConfig = function (target, dependencies) {
this.target = target;
this.dependencies = dependencies;
this.onEachRequest = dependencies;
};
// #region properties
BindingConfig.prototype.target = null;
BindingConfig.prototype.dependencies = [];
BindingConfig.prototype.toInstantiate = [];
BindingConfig.prototype.toCache = [];
// #endregion
// #region methods
BindingConfig.prototype.asInstance = function (toInstantiate) {
if (toInstantiate) {
this.toInstantiate = toInstantiate;
} else {
this.toInstantiate = this.dependencies;
}
return this;
};
BindingConfig.prototype.cache = function (toCache) {
if (toCache) {
this.toCache = toCache;
}
return this;
};
// #endregion
module.exports = BindingConfig;