index.js
function CanaryStore() {
  var self = this;
  EventEmitter.call(self);
  var counter = self._counter = new Counter();
  counter.on('resource', self._onresource.bind(self));

  self._id = 0;
  self._variants = {};
  self._callbacks = {};
  self._assigners = [];
  self._assignments = {};
  self._overrides = {};
  self._pending = 0;

  // create a global context for simple cases
  var context = this._globalContext = this.context(this.emit.bind(this, 'change'));
  this.get = context.get.bind(context);
  this.start = context.start.bind(context);
  this.stop = context.stop.bind(context);
}
function CanaryStore() {
  var self = this;
  EventEmitter.call(self);
  var counter = self._counter = new Counter();
  counter.on('resource', self._onresource.bind(self));

  self._id = 0;
  self._variants = {};
  self._callbacks = {};
  self._assigners = [];
  self._assignments = {};
  self._overrides = {};
  self._pending = 0;

  // create a global context for simple cases
  var context = this._globalContext = this.context(this.emit.bind(this, 'change'));
  this.get = context.get.bind(context);
  this.start = context.start.bind(context);
  this.stop = context.stop.bind(context);
}
function CanaryStore ( ) { var self = this ; EventEmitter . call ( self ) ; var counter = self . _counter = new Counter ( ) ; counter . on ( 'resource' , self . _onresource . bind ( self ) ) ; self . _id = 0 ; self . _variants = { } ; self . _callbacks = { } ; self . _assigners = [ ] ; self . _assignments = { } ; self . _overrides = { } ; self . _pending = 0 ; // create a global context for simple cases var context = this . _globalContext = this . context ( this . emit . bind ( this , 'change' ) ) ; this . get = context . get . bind ( context ) ; this . start = context . start . bind ( context ) ; this . stop = context . stop . bind ( context ) ; }
Create a CanaryStore
Create a CanaryStore