Skip to content

killscreen/nymize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nymize ⇒ function

Create a function which will provide named instances of some other kind of object. The created function will use the provided factory to create new instances of those objects. The created function will always return values provided by the factory; the resulting instances will vary depending on the name argument provided to the created function:

  • If a name is provided, the resulting instance will be the same instance that was returned the last time the created function was called with that name, except in the case where there is no "last time"; then it will be a new instance.
  • If no name is provided, a new "anonymous" instance will be provided. The same instance will never be returned again.

Returns: function - an instantiation function.

Param Type Description
factory function a factory to return instances.

About

Node.js library for creating named instances of things.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published