Hi there, it's me again :)
I have the following context class:
module.exports = Backbone.Geppetto.Context.extend( {
wiring : {
commands : {
"app:startup.requested": require('./commands/RegisterHelpers.js')
}
},
initialize : function(){
this.dispatch('app:startup.requested');
}
} );
This unfortunately won't run, since a contexts initialize method is run (https://github.com/ModelN/backbone.geppetto/blob/master/backbone.geppetto.js#L190) before the parsing of the wiring object (https://github.com/ModelN/backbone.geppetto/blob/master/backbone.geppetto.js#L198).
It seems we could move the initialize method invocation to the last line, but I'm not entirely sure?
BTW there's quite a few mistakes in the documentation: e.g. 'commands' > 'option2: using the commands map' shows
return Geppetto.Context.extend( {
commands: {
"appEventFoo": FooCommand,
"appEventBar": BarCommand,
"appEventBaz": BazCommand,
"appEventFooBarBaz": [
FooCommand,
BarCommand,
BazCommand
]
}
});
but the commands object should be wrapped in a wiring object.
Also in 'Setting up wiring in the context' the example is:
return Geppetto.Context.extend( {
initialize: function () {
wiring: {
singletons: {
"userModel": Backbone.Model,
"productModel": ProductModel,
"loggingSvc": LoggingSvc
},
views: {
"UserView": UserView,
"ProductView": ProductView
}
}
}
});
but the wiring object should be moved to outside the initialize function.
Sorry if I am to blame, my memory's so terrible I can't remember whether this is stuff I wrote or not?
Hi there, it's me again :)
I have the following context class:
This unfortunately won't run, since a contexts
initializemethod is run (https://github.com/ModelN/backbone.geppetto/blob/master/backbone.geppetto.js#L190) before the parsing of thewiringobject (https://github.com/ModelN/backbone.geppetto/blob/master/backbone.geppetto.js#L198).It seems we could move the initialize method invocation to the last line, but I'm not entirely sure?
BTW there's quite a few mistakes in the documentation: e.g. 'commands' > 'option2: using the commands map' shows
but the
commandsobject should be wrapped in awiringobject.Also in 'Setting up wiring in the context' the example is:
but the
wiringobject should be moved to outside theinitializefunction.Sorry if I am to blame, my memory's so terrible I can't remember whether this is stuff I wrote or not?