How to use the di.annotate function in di

To help you get started, we’ve selected a few di 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 RackHD / on-dhcp-proxy / lib / message-handler.js View on Github external
// Copyright 2015, EMC, Inc.

"use strict";

var di = require('di');

module.exports = messageHandlerFactory;
di.annotate(messageHandlerFactory, new di.Provide('DHCP.messageHandler'));
di.annotate(messageHandlerFactory, new di.Inject(
        'DHCP.packet',
        'DHCP.parser',
        'Services.Lookup',
        'Services.Configuration',
        'Protocol.Task',
        'Services.Waterline',
        'Logger',
        'Assert',
        'Errors',
        'Promise',
        '_'
    )
);
function messageHandlerFactory(
    packetUtil,
    parser,
github RackHD / on-dhcp-proxy / lib / isc-dhcp-lease-poller.js View on Github external
// Copyright 2016, EMC, Inc.

'use strict';

var di = require('di');

module.exports = iscDhcpLeasePollerFactory;
di.annotate(iscDhcpLeasePollerFactory, new di.Provide('DHCP.IscDhcpLeasePoller'));
di.annotate(iscDhcpLeasePollerFactory, new di.Inject(
    'Services.Lookup',
    'Services.Configuration',
    'Logger',
    'Promise',
    'Assert',
    'Tail',
    '_',
    'PromiseQueue'
));

function iscDhcpLeasePollerFactory(
    lookupService,
    configuration,
    Logger,
    Promise,
    assert,
github iammerrick / the-frankenstein-framework / code / src / monsters / Frankenstein.js View on Github external
import {annotate, TransientScope, Inject} from 'di';
class Frankenstein {
  constructor(options) {
    this.name = options.login; 
    this.location = options.location;
    this.blog = options.blog;
    this.avatar_url = options.avatar_url;
  }
}
annotate(Frankenstein, new TransientScope());
annotate(Frankenstein, new Inject('options'));

export default Frankenstein;
github chrisguttandin / standardized-audio-context / src / is-supported.js View on Github external
'use strict';

import { annotate, Inject } from 'di';
import { Modernizr } from './modernizr';

export function provider (modernizr) {

    return modernizr.promises && modernizr.typedarrays && modernizr.webaudio;

}

annotate(provider, new Inject(Modernizr));
github joelhooks / react-rxjs-angular-di-todomvc / src / app / actions / TodoActions.js View on Github external
title: todo.title,
              isComplete: checked
          };
        });
      })
      .subscribe(this.updates);

    this.clearCompleted
      .map(() => {
        return (todos) => todos.filter((todo) => !todo.isComplete)
      })
      .subscribe(this.updates);
  }
}

di.annotate(TodoActions, new di.Inject(TodoStore));

module.exports = TodoActions;