-
Notifications
You must be signed in to change notification settings - Fork 1.5k
AMD modules and events #412
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Did you manage to get this working? I'm having a similar issue. |
nope, @patocallaghan, I gave up. Hope this will become part of the documentation soon. |
Using some of the examples in the unit test fixtures, I came up with the example below as an illustration. Is this useful? /**
Some description of the playground/monitor module.
@module playground/monitor
*/
define('playground/monitor', [], function () {
var exports = {
/**
@method module:playground/monitor.reportThrowage
@listens module:hurler#snowball
*/
reportThrowage: function (e) {
this.log('snowball thrown: velocity ' + e.velocity);
}
};
return exports;
});
/**
Some description of the hurler module.
@module hurler
*/
define('hurler', [], function () {
/**
Some description of snowball events.
@event module:hurler#snowball
@property {number} velocity
*/
var exports = {
/**
@method module:hurler.attack
@fires module:hurler#snowball
*/
attack: function (e) {
this.emit('snowball', { velocity: 10 });
}
};
return exports;
}); |
Thanks @micmath, It's kind of working now but I'll just have to rework some of my comments to make it work properly. Thanks for the tip about the tests. @turboteddy have a look here and you may be able to reverse-engineer how the events work... |
Added to the |
I would be very thankful if you could provide an example in documentation on how to document events in the context of AMD modules (including the tags
@event
,@fires
and@listens
). Have tried numerous of combinations of syntax, but no result as expected... Hard to get my head around this one. E.g., what is the best way to document something like this?...in combination with:
Any feedback / documentation would be highly appreciated!
The text was updated successfully, but these errors were encountered: