Skip to content

createInstance triggers Map "created" event

Compare
Choose a tag to compare
@marshallswain marshallswain released this 19 Dec 22:49
· 500 commits to master since this release

Calling createInstance will now trigger the created event on any connected Map constructor.

var Session = DefineMap.extend({
  id: 'any',
  email: 'string'
});

var connection = connect([
  constructor,
  canMap,
  constructorStore,
  dataCallbacks,
  realTime,
  callbacksOnce
], {
  Map: Session
});

Session.on('created', function (event) {
  assert.ok(event, 'createInstance triggered the "created" event');
  done();
});

connection.createInstance({
  id: 5,
  email: 'marshall@bitovi.com'
});

PR: #225