How to use bottlejs - 7 common examples

To help you get started, we’ve selected a few bottlejs 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 kristianmandrup / red-elements / packages / red-widgets / src / setup / _setup.js View on Github external
active: () => { }
    }
  },
   keyboard : {
    remove(selector) { },
    add(selector) { }
  },
  /**
   *  setDisabled
   */
   menu : {
    setDisabled() { }
  },
  notify(func, node) { }
}
var bottle = new Bottle();
var _RED = function () {
  return RED;
}
bottle.service("RED", _RED);
// bottle.service("Menu", MenuFactory, 'RED');
export { bottle };
github MitocGroup / deep-framework / src / deep-di / lib / DI.js View on Github external
constructor() {
    this._bottle = new Bottle();
    this._localBackend = false;
  }
github rezozero / starting-blocks / src / StartingBlocks.js View on Github external
constructor (config = {}) {
        this.bottle = new Bottle()
        this.bootables = []

        this.bottle.value('Config', {
            ...CONFIG.defaults,
            ...config
        })

        window.startingBlocksDebugLevel = this.bottle.container.Config.debug

        this.provider('Dom', Dom)
        this.provider('BlockBuilder', BlockBuilder)
        this.instanceFactory('DefaultPage', c => {
            return new DefaultPage(c)
        })
    }
github vend / ecs-cleaner / src / deps.js View on Github external
export default (config) => {
  const deps = new Bottle();
  Bottle.config.strict = true;

  deps.constant('config', config);
  deps.service('cli.log', () => log);

  deps.service('api', api, 'config', 'aws.ecs', 'aws.ecr');

  deps.service('aws.ecs', awsEcs, 'config');
  deps.service('aws.ecr', awsEcr, 'config');
  deps.service('aws.ec2', awsEc2, 'config');

  /**
   * @param {string} name
   * @param {cli.command} instance
   * @param {Array.} extraServices
   * @returns {string}
github amazing-gao / koa-oai-router / src / container.js View on Github external
constructor() {
    this.bottle = new Bottle();
  }
github GorillaStack / serverless-slack-memebot / bot / src / container.js View on Github external
export default function getContainer() {
  const bottle = new Bottle();

  bottle.value('Logger', getLogger(config.logger));

  bottle.factory('SlackApiManager', container => {
    const service = new SlackApiManager();
    service.setLogger(container.Logger);
    service.setConfig(config.slack);
    return service;
  });

  bottle.factory('MemeApiManager', container => {
    const service = new MemeApiManager();
    service.setLogger(container.Logger);
    return service;
  });
github vend / ecs-cleaner / src / deps.js View on Github external
export default (config) => {
  const deps = new Bottle();
  Bottle.config.strict = true;

  deps.constant('config', config);
  deps.service('cli.log', () => log);

  deps.service('api', api, 'config', 'aws.ecs', 'aws.ecr');

  deps.service('aws.ecs', awsEcs, 'config');
  deps.service('aws.ecr', awsEcr, 'config');
  deps.service('aws.ec2', awsEc2, 'config');

  /**
   * @param {string} name
   * @param {cli.command} instance
   * @param {Array.} extraServices
   * @returns {string}
   */

bottlejs

A powerful dependency injection micro container

MIT
Latest version published 2 years ago

Package Health Score

58 / 100
Full package analysis

Popular bottlejs functions