source: trip-planner-front/node_modules/di/lib/module.js@ eed0bf8

Last change on this file since eed0bf8 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 476 bytes
Line 
1var Module = function() {
2 var providers = [];
3
4 this.factory = function(name, factory) {
5 providers.push([name, 'factory', factory]);
6 return this;
7 };
8
9 this.value = function(name, value) {
10 providers.push([name, 'value', value]);
11 return this;
12 };
13
14 this.type = function(name, type) {
15 providers.push([name, 'type', type]);
16 return this;
17 };
18
19 this.forEach = function(iterator) {
20 providers.forEach(iterator);
21 };
22};
23
24module.exports = Module;
Note: See TracBrowser for help on using the repository browser.