How to use the inversify/lib/planning/planner.getBindingDictionary function in inversify

To help you get started, we’ve selected a few inversify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RobinBuschmann / react.di / lib / container-service.ts View on Github external
export function merge(container1: Container, container2: Container): Container {
  const container = new Container();
  const bindingDictionary: interfaces.Lookup> = getBindingDictionary(container);
  const bindingDictionary1: interfaces.Lookup> = getBindingDictionary(container1);
  const bindingDictionary2: interfaces.Lookup> = getBindingDictionary(container2);

  function copyDictionary(origin: interfaces.Lookup>,
                          destination: interfaces.Lookup>) {
    origin.traverse((key, value) => {
      value.forEach((binding) => {
        destination.add(binding.serviceIdentifier, binding);
      });
    });
  }

  copyDictionary(bindingDictionary1, bindingDictionary);
  copyDictionary(bindingDictionary2, bindingDictionary);

  return container;
github RobinBuschmann / react.di / lib / container-service.ts View on Github external
export function merge(container1: Container, container2: Container): Container {
  const container = new Container();
  const bindingDictionary: interfaces.Lookup> = getBindingDictionary(container);
  const bindingDictionary1: interfaces.Lookup> = getBindingDictionary(container1);
  const bindingDictionary2: interfaces.Lookup> = getBindingDictionary(container2);

  function copyDictionary(origin: interfaces.Lookup>,
                          destination: interfaces.Lookup>) {
    origin.traverse((key, value) => {
      value.forEach((binding) => {
        destination.add(binding.serviceIdentifier, binding);
      });
    });
  }

  copyDictionary(bindingDictionary1, bindingDictionary);
  copyDictionary(bindingDictionary2, bindingDictionary);

  return container;
}
github RobinBuschmann / react.di / lib / container-service.ts View on Github external
export function merge(container1: Container, container2: Container): Container {
  const container = new Container();
  const bindingDictionary: interfaces.Lookup> = getBindingDictionary(container);
  const bindingDictionary1: interfaces.Lookup> = getBindingDictionary(container1);
  const bindingDictionary2: interfaces.Lookup> = getBindingDictionary(container2);

  function copyDictionary(origin: interfaces.Lookup>,
                          destination: interfaces.Lookup>) {
    origin.traverse((key, value) => {
      value.forEach((binding) => {
        destination.add(binding.serviceIdentifier, binding);
      });
    });
  }

  copyDictionary(bindingDictionary1, bindingDictionary);
  copyDictionary(bindingDictionary2, bindingDictionary);

  return container;
}