meteor-space / base

Foundation for Modular Application Architecture in Meteor.
MIT License
75 stars 5 forks source link

Feature/mixin constructor hook #62

Closed DominikGuzei closed 8 years ago

DominikGuzei commented 8 years ago

Makes it possible to define a onConstruction hook on any mixin that gets called when the host class is constructed:

myMixin = onConstruction: sinon.spy()
TestClass = Space.Object.extend(mixin: myMixin)
first = {}
second = {}
new TestClass(first, second)
expect(myMixin.onConstruction).to.have.been.calledWithExactly(first, second)
darko-mijic commented 8 years ago

Space is starting to look like ES9 :)

rhyslbw commented 8 years ago

This is solid, exactly what I was thinking yesterday