fuzzyioc
A "fuzzy" matching ioc container.
The vision
As suggested by @rinojohnsen;
An ioc container should "fuzzy" match dependencies to inject based on what members and method calls are used on the dependencies of a function.
Installation
npm install fuzzyioc
Run tests
npm test
Usage
var fuzzyioc = ; var ioc = ;ioc; var view = ;viewmsg // "Yeah!" { thismsg = msgs;} { var keys = "some.message.key": "Yeah!" ; this { return keyskey; };}
Todo
- Record number of parameters to function calls of dependencies. Use this to better match agains registered types.
- Follow assignments to
this
inside a function, so that a we can track usage (ofthis.something
) along the prototype as well - Track usage on the prototype
- Support singletons