How to use the di.TransientScope 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 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;