Want to see pretty graphs? Log in now!
npm install ioc
|6||downloads in the last week|
|24||downloads in the last month|
|Last Published By|
|Version||0.1.0 last updated a year ago|
|Keywords||ioc, service, locator|
Register an item with the ioc - the item can be any type, callback or otherwise
ioc.replace(name, callback, singleton)
Replaces an item in the registry with the second argument. Pass true as the third argument to register as a singleton
ioc.registerOrReplace(name, callback, singleton)
Registers an item if it doesn't exist yet, replaces it otherwise
Returns a boolean, whether the name has been registered on the container
Removes the item from the registry by name
Registers a callback as a singleton. No-op if the second argument isn't a function
Resolves the item associated with "name", with any additional arguments used in invoking the callback. The callback will also be called with the context of "ioc".
Calls the function associated with "name" as constructor, with any arguments following name passed to the constructor.