You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14-3Lines changed: 14 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,17 +10,18 @@ Skippy is designed to be an easy to use, robust, and well tested dependencies co
10
10
- Instantiate service as described in the dependencies configuration.
11
11
- Configure what should be used as service constructor parameters: you can pass another services as reference, parameters, or any values you have configured.
12
12
- Manage singleton instance of service (not defined by design pattern, but by configuration).
13
-
- Check the dependencies graph to avoid cyclic dependencies (only on development environment: `NODE_ENV="development"`).
13
+
- Call custom method on service instance to finish it configuration.
14
+
- Check the dependencies graph to avoid cyclic dependencies.
14
15
- Allowing injection of service mock (only in test environment: `NODE_ENV="test"`).
15
16
16
17
#### What Skippy don't do (and never will)
17
18
- Introspect JSDoc or parameters name to determine witch service should be inject in a constructor function. You have to define service dependencies in a configuration file.
18
19
- Coffee
19
20
20
21
#### What Skippy don't at the moment (maybe one day)
21
-
- Use factory service to generate another service
22
-
- Generate a lazy loading proxy function
23
22
- Manage service scope (allowing private service, who can only be used to instantiate other service, not exposed to the world)
23
+
- Use factory service to generate another service (delayed, the post service creation hooks do a part of the job for now)
24
+
- Generate a lazy loading proxy function (delayed, until ES6 proxy is well supported)
24
25
25
26
26
27
## Installation
@@ -100,6 +101,15 @@ module.exports = [
100
101
"@foo.serviceA",
101
102
"@foo.serviceB"
102
103
]
104
+
},
105
+
{
106
+
"name":"foo.serviceD",
107
+
"service":require("./ServiceD"),
108
+
"calls": {
109
+
"setLocale": [
110
+
"@foo.serviceB",
111
+
"%default.locale%"
112
+
]
103
113
}
104
114
];
105
115
```
@@ -109,6 +119,7 @@ A service configuration have four possible keys:
109
119
- `service` (`function`, mandatory): the service constructor function reference.
110
120
- `singleton` (`boolean`, optional, default `true`): If `true`, the service will be a singleton. If `false`, a new service will be instantiated each time.
111
121
- `arguments` (`array`, optional, default empty array): An array of the value to inject in the service constructor (see "Arguments" section for more informations).
122
+
- `calls` (`object`, optional, default empty array): A map of the method to call on the service, each method should have it `arguments` array (see "Arguments" section for more informations).
0 commit comments