domino.js
domino.js copied to clipboard
More classic asynchronous workflow potentiel
In a project I'm currently working on, I must load dynamically assets from my modules, and it's pretty painful, right now.
These assets cannot be referenced independantly in my domino controler, so since they are all lists, the property "lists"
represents them:
- In my module constructor, I cannot dispatch event, since the events bindings are not done yet.
- Let's say I can dispatch my event (with some dirty
setTimeout
, for instance). So, I now when some assets are loaded (through the"listsUpdated"
event), but I am not sure yet that this is actually the piece I need. Indeed, some other modules created at the same time might have asked for some other assets, right?
So, basically, what I suggest here is that for this kind of cases precisely, I would definitely enjoy to use a more classic, callback-based syntax to communicate from the module...