How to use the typedi.default function in typedi

To help you get started, we’ve selected a few typedi 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 rockstat / front / dist / bus / flat.js View on Github external
constructor() {
        this.map = new WeakMap();
        this.noneHdr = async (key, msg) => { };
        this.handlers = {};
        this.log = typedi_1.default.get(rock_me_ts_1.Logger).for(this);
    }
    setNoneHdr(hdr) {
github rockstat / front / dist / lib / redis / client.js View on Github external
constructor() {
        this.started = false;
        this.on = (event, func) => {
            this.client.on(event, func);
        };
        const deps = this.log = typedi_1.default.get(log_1.LogFactory).for(this);
        this.options = typedi_1.default.get(lib_1.Configurer).get('redis');
        const { host, port, db } = this.options;
        this.log.info('Starting redis client. Server: %s:%s/%d', host, port, db);
        this.client = new Redis(this.options);
        //happen only once
        this.client.on('ready', () => {
            this.log.info('redis ready');
        });
        //happen each time when reconnected
        this.client.on('connect', () => {
            this.log.info('redis connected');
        });
        this.client.on('disconnect', () => {
            this.log.info('redis disconnected');
        });
        this.client.on('reconnecting', (num) => {
            this.log.info('redis reconnecting with attempt #' + num);
github rockstat / front / dist / lib / redis / client.js View on Github external
constructor() {
        this.started = false;
        this.on = (event, func) => {
            this.client.on(event, func);
        };
        const deps = this.log = typedi_1.default.get(log_1.LogFactory).for(this);
        this.options = typedi_1.default.get(lib_1.Configurer).get('redis');
        const { host, port, db } = this.options;
        this.log.info('Starting redis client. Server: %s:%s/%d', host, port, db);
        this.client = new Redis(this.options);
        //happen only once
        this.client.on('ready', () => {
            this.log.info('redis ready');
        });
        //happen each time when reconnected
        this.client.on('connect', () => {
            this.log.info('redis connected');
        });
        this.client.on('disconnect', () => {
            this.log.info('redis disconnected');
        });
        this.client.on('reconnecting', (num) => {
github rockstat / front / dist / bus / tree_name.js View on Github external
constructor() {
        this.map = new Map();
        this.tree = {
            handlers: [],
            children: {}
        };
        this.log = typedi_1.default.get(rock_me_ts_1.Logger).for(this);
    }
    handlerEvents(handler) {
github rockstat / front / dist / bus / tree.js View on Github external
constructor() {
        this.map = new WeakMap();
        this.tree = {
            handlers: [],
            children: {}
        };
        this.log = typedi_1.default.get(rock_me_ts_1.Logger).for(this);
    }
    handlerEvents(handler) {