Skip to content

Commit

Permalink
Add the calls hook to the README.md.
Browse files Browse the repository at this point in the history
  • Loading branch information
armandabric committed Sep 2, 2015
1 parent 434a346 commit a992844
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,18 @@ Skippy is designed to be an easy to use, robust, and well tested dependencies co
- Instantiate service as described in the dependencies configuration.
- Configure what should be used as service constructor parameters: you can pass another services as reference, parameters, or any values you have configured.
- Manage singleton instance of service (not defined by design pattern, but by configuration).
- Check the dependencies graph to avoid cyclic dependencies (only on development environment: `NODE_ENV="development"`).
- Call custom method on service instance to finish it configuration.
- Check the dependencies graph to avoid cyclic dependencies.
- Allowing injection of service mock (only in test environment: `NODE_ENV="test"`).

#### What Skippy don't do (and never will)
- 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.
- Coffee

#### What Skippy don't at the moment (maybe one day)
- Use factory service to generate another service
- Generate a lazy loading proxy function
- Manage service scope (allowing private service, who can only be used to instantiate other service, not exposed to the world)
- Use factory service to generate another service (delayed, the post service creation hooks do a part of the job for now)
- Generate a lazy loading proxy function (delayed, until ES6 proxy is well supported)


## Installation
Expand Down Expand Up @@ -100,6 +101,15 @@ module.exports = [
"@foo.serviceA",
"@foo.serviceB"
]
},
{
"name": "foo.serviceD",
"service": require("./ServiceD"),
"calls": {
"setLocale": [
"@foo.serviceB",
"%default.locale%"
]
}
];
```
Expand All @@ -109,6 +119,7 @@ A service configuration have four possible keys:
- `service` (`function`, mandatory): the service constructor function reference.
- `singleton` (`boolean`, optional, default `true`): If `true`, the service will be a singleton. If `false`, a new service will be instantiated each time.
- `arguments` (`array`, optional, default empty array): An array of the value to inject in the service constructor (see "Arguments" section for more informations).
- `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).


### Arguments
Expand Down

0 comments on commit a992844

Please sign in to comment.