Skip to content
This repository was archived by the owner on Apr 29, 2019. It is now read-only.
This repository was archived by the owner on Apr 29, 2019. It is now read-only.

What about multibindings? #3

@agibalov

Description

@agibalov

Hinoki seems to be the least surprising IoC container available for Node. I definitely do like its ascetic worldview. Thanks a lot for this! Yet, are there any plans for the future releases?

I was wondering if it's possible to achieve something like this with the current 0.3.0-beta.16:

var container = {
  values: { a: 11, b: 22, c: 33 },
  factories: {
    handlers: [ // factory functions may return promises as well
      function(a, b) { return new HandlerA(a, b); },
      function(a, c) { return new HandlerB(a, c); },
      function(a, b, c) { return new HandlerC(a, b, c); }
    ]
  }
};

hinoki.get(container, 'handlers').then(function(handlers) {
  // handlers[0] - an instance of HandlerA
  // handlers[1] - an instance of HandlerB
  // handlers[2] - an instance of HandlerC
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions